added raylib for initial window/display.

This commit is contained in:
2026-05-16 09:07:19 +02:00
parent 4fec0b5d94
commit 8ff22fac55
+27
View File
@@ -1,3 +1,30 @@
package machine
import rl "vendor:raylib"
// Handle the "display" and all of its required functions
// raylib window, rendering, scale constants
SCALE :: 20
SCREEN_WITDH :: 64 * SCALE
SCREEN_HEIGHT :: 32 * SCALE
// Display will handle all the screen drawing with raylib etc
init_display_and_cycle :: proc(s: ^System) {
rl.InitWindow(SCREEN_WITDH, SCREEN_HEIGHT, "chip8")
// Cap at 60hz/60fps
rl.SetTargetFPS(60)
for !rl.WindowShouldClose() {
rl.BeginDrawing()
rl.ClearBackground(rl.WHITE)
// Do a cpu cycle
cycle(s)
rl.EndDrawing()
}
rl.CloseWindow()
}