Moved stuff
This commit is contained in:
parent
a4dd76a186
commit
5377458895
234 changed files with 12 additions and 1 deletions
46
src/main.odin
Normal file
46
src/main.odin
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
package main
|
||||
|
||||
import rl "libraries/raylib"
|
||||
import "base:runtime"
|
||||
|
||||
WINDOW_WIDTH :: 1280
|
||||
WINDOW_HEIGHT :: 720
|
||||
WINDOW_FRAMERATE :: 60
|
||||
WINDOW_CAPTION :: "Transformation Visualizer"
|
||||
|
||||
init :: proc() {
|
||||
rl.SetTraceLogLevel(.WARNING)
|
||||
rl.SetConfigFlags({.VSYNC_HINT})
|
||||
rl.InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_CAPTION)
|
||||
rl.SetTargetFPS(WINDOW_FRAMERATE)
|
||||
program_init()
|
||||
}
|
||||
|
||||
update :: proc() {
|
||||
rl.BeginDrawing()
|
||||
defer rl.EndDrawing()
|
||||
rl.ClearBackground(rl.BLACK)
|
||||
program_update()
|
||||
free_all(context.temp_allocator)
|
||||
}
|
||||
|
||||
parent_window_size_changed :: proc(w, h: int) {
|
||||
rl.SetWindowSize(i32(w), i32(h))
|
||||
}
|
||||
|
||||
shutdown :: proc() {
|
||||
rl.CloseWindow()
|
||||
}
|
||||
|
||||
should_run :: proc() -> bool {
|
||||
when ODIN_OS != .JS {
|
||||
if rl.WindowShouldClose() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
delta_time_fraction :: proc() -> f32 {
|
||||
return rl.GetFrameTime() / (1.0 / WINDOW_FRAMERATE)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue