This commit is contained in:
2024-10-11 23:32:26 +02:00
parent 5d3a620fa7
commit 327e4be1c9
3 changed files with 50 additions and 5 deletions

View File

@@ -166,8 +166,6 @@ Input_State :: struct {
last_touched: Last_Touched_State; last_touched: Last_Touched_State;
} }
input : Input_State;
init_input :: () { init_input :: () {
input = .{}; input = .{};
input.has_char = false; input.has_char = false;

View File

@@ -1,2 +1,51 @@
#load "core/entity.jai"; #load "core/entity.jai";
#load "core/scene.jai"; #load "core/scene.jai";
window: *Window;
renderer: *Renderer;
input : Input_State;
time: float;
dt: float;
quit: bool;
init :: (window_title: string, window_width: u32, window_height: u32, fullscreen: bool) {
window = Coven.create_window(GAME_NAME, 1400, xx (1400.0*aspect), true);
renderer = Coven.create_renderer(window);
renderer.vsync = true;
init_input();
init_audio_system();
init_console();
}
run :: (update_func: (float)) {
time = xx seconds_since_init();
while !quit {
//reset_temporary_storage();
frame_index += 1;
update_input();
quit = key_down(.ESCAPE);
now : float = xx seconds_since_init();
dt = now - time;
time = now;
update_console();
update_func(min(0.4, dt));
update_audio(dt);
render();
//SDL_Delay(1);
}
SDL_DestroyWindow(window);
SDL_Quit();
}

View File

@@ -1,5 +1,3 @@
renderer : *Renderer;
Pipeline_State_Handle :: #type, distinct u32; Pipeline_State_Handle :: #type, distinct u32;
Shader_Handle :: #type, distinct u32; Shader_Handle :: #type, distinct u32;
Buffer_Handle :: #type, distinct u32; Buffer_Handle :: #type, distinct u32;