Changes
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
51
module.jai
51
module.jai
@@ -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();
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user