added raylib for initial window/display.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user