Compiles again
This commit is contained in:
40
module.jai
40
module.jai
@@ -9,48 +9,71 @@ DEBUG :: true;
|
||||
editor: Editor;
|
||||
}
|
||||
|
||||
Engine_Mode :: enum {
|
||||
PLAYING;
|
||||
EDITING;
|
||||
}
|
||||
mode: Engine_Mode;
|
||||
|
||||
window: *Window;
|
||||
renderer: *Renderer;
|
||||
input : Input_State;
|
||||
current_scene: *Scene;
|
||||
|
||||
camera_buffer : Buffer_Handle;
|
||||
screen_data_buffer : Buffer_Handle;
|
||||
directional_light_buffer : Buffer_Handle;
|
||||
|
||||
time: float;
|
||||
dt: float;
|
||||
quit: bool;
|
||||
frame_index : u64 = 0;
|
||||
|
||||
coven_init :: (window_title: string, window_width: u32, window_height: u32, fullscreen: bool) {
|
||||
window = create_window(GAME_NAME, 1400, xx (1400.0*aspect), true);
|
||||
window = create_window(window_title, window_width, window_height, fullscreen);
|
||||
renderer = create_renderer(window);
|
||||
renderer.vsync = true;
|
||||
|
||||
init_input();
|
||||
init_audio_system();
|
||||
init_console();
|
||||
|
||||
ui_init();
|
||||
}
|
||||
|
||||
coven_run :: (update_func: (float)) {
|
||||
coven_run :: (game_update_proc: (float)) {
|
||||
time = xx seconds_since_init();
|
||||
|
||||
while !quit {
|
||||
//reset_temporary_storage();
|
||||
|
||||
frame_index += 1;
|
||||
|
||||
update_input();
|
||||
|
||||
quit = key_down(.ESCAPE);
|
||||
|
||||
// @Incomplete
|
||||
if key_pressed(.SHIFT) && key_down(.ESCAPE) {
|
||||
quit = true;
|
||||
}
|
||||
|
||||
now : float = xx seconds_since_init();
|
||||
dt = now - time;
|
||||
time = now;
|
||||
|
||||
update_fps_counter(dt);
|
||||
|
||||
update_console();
|
||||
|
||||
update_func(min(0.4, dt));
|
||||
ui_begin();
|
||||
|
||||
game_update_proc(min(0.4, dt));
|
||||
|
||||
ui_end();
|
||||
|
||||
update_audio(dt);
|
||||
|
||||
render();
|
||||
|
||||
//SDL_Delay(1);
|
||||
}
|
||||
|
||||
SDL_DestroyWindow(window);
|
||||
@@ -75,6 +98,9 @@ coven_run :: (update_func: (float)) {
|
||||
#load "core/camera.jai";
|
||||
#load "core/console.jai";
|
||||
#load "audio/audio.jai";
|
||||
#load "core/fps.jai";
|
||||
|
||||
#scope_export
|
||||
|
||||
#import "Bucket_Array";
|
||||
#import "Basic";
|
||||
@@ -82,6 +108,6 @@ coven_run :: (update_func: (float)) {
|
||||
#import "System";
|
||||
#import "Flat_Pool";
|
||||
#import "Hash_Table";
|
||||
#import "File";
|
||||
File :: #import "File";
|
||||
#import "File_Watcher";
|
||||
#import "File_Utilities";
|
||||
Reference in New Issue
Block a user