Added function to render the display buffer.
This commit is contained in:
+14
-10
@@ -27,19 +27,23 @@ run_system :: proc(s: ^System) {
|
|||||||
cycle(s)
|
cycle(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// update display with display buffer bits
|
render_display_buffer(&s.display)
|
||||||
// get row
|
|
||||||
for y in 0..<len(s.display) {
|
|
||||||
// get cols
|
|
||||||
for x in 0..<len(s.display[0]) {
|
|
||||||
if s.display[y][x] == 0x01 {
|
|
||||||
rl.DrawRectangle(i32(x * SCALE), i32(y * SCALE), SCALE, SCALE, rl.WHITE)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rl.EndDrawing()
|
rl.EndDrawing()
|
||||||
}
|
}
|
||||||
|
|
||||||
rl.CloseWindow()
|
rl.CloseWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update display with display buffer bits
|
||||||
|
render_display_buffer :: proc(display_buffer: ^[32][64]u8) {
|
||||||
|
// get row
|
||||||
|
for y in 0..<len(display_buffer) {
|
||||||
|
// get cols
|
||||||
|
for x in 0..<len(display_buffer[0]) {
|
||||||
|
if display_buffer[y][x] == 0x01 {
|
||||||
|
rl.DrawRectangle(i32(x * SCALE), i32(y * SCALE), SCALE, SCALE, rl.WHITE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user