Successfully rendered a quad!
This commit is contained in:
23
pass.odin
23
pass.odin
@@ -1,6 +1,29 @@
|
||||
package renderer
|
||||
|
||||
import "core:fmt"
|
||||
|
||||
MAX_DRAW_COMMANDS_PER_PASS :: 4096
|
||||
|
||||
Pass :: struct {
|
||||
name: string,
|
||||
clear_color: RGB_Color,
|
||||
|
||||
draw_commands: [MAX_DRAW_COMMANDS_PER_PASS]Draw_Command,
|
||||
draw_command_count: u32,
|
||||
}
|
||||
|
||||
Draw_Command :: struct {
|
||||
mesh: Mesh,
|
||||
material: Material,
|
||||
}
|
||||
|
||||
add_command_to_pass :: proc(pass: ^Pass, command: Draw_Command) -> bool {
|
||||
if pass.draw_command_count >= len(pass.draw_commands) {
|
||||
return false
|
||||
}
|
||||
|
||||
pass.draw_commands[pass.draw_command_count] = command
|
||||
pass.draw_command_count += 1
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user