diff --git a/src/asset.h b/src/asset.h index 6bcfa0b..891b055 100644 --- a/src/asset.h +++ b/src/asset.h @@ -4,10 +4,8 @@ #include #include +#include "types.h" -typedef uint8_t u8; -typedef int32_t i32; -typedef uint64_t u64; //----------------- // Hashing diff --git a/src/main.cpp b/src/main.cpp index f3abb0d..c7a2013 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,9 +6,32 @@ #include #include "asset.h" +#include "dumbLog.h" #include "shader.h" +#include "types.h" +struct SDLHandles +{ + SDL_Window* window; + SDL_GLContext sdl_gl_ctx; + SDL_DisplayMode display_mode; +}; + +struct RenderState +{ + memory_arena* arena; + model_assets* assets; + texture_assets* textures; + + transforms* xforms; // NOTE: would be part of camera in libTangerine + SDLHandles* handles; + + GLContext* gl_ctx; + gl_mesh_array* gl_mesh_arr; + light_array lights; +}; + mesh initCubeMesh() { diff --git a/src/shader.h b/src/shader.h index 2eb247d..35a5c65 100644 --- a/src/shader.h +++ b/src/shader.h @@ -5,8 +5,7 @@ #include #include - -typedef uint32_t u32; +#include "types.h" // FIXME: won't need this enum when dynamic shader parsing is working @@ -129,27 +128,6 @@ struct light_array point_light* lights; }; -struct SDLHandles -{ - SDL_Window* window; - SDL_GLContext sdl_gl_ctx; - SDL_DisplayMode display_mode; -}; - -struct RenderState -{ - memory_arena* arena; - model_assets* assets; - texture_assets* textures; - - transforms* xforms; // NOTE: would be part of camera in libTangerine - SDLHandles* handles; - - GLContext* gl_ctx; - gl_mesh_array* gl_mesh_arr; - light_array lights; -}; - struct node; struct entity; struct animation; diff --git a/src/types.h b/src/types.h new file mode 100644 index 0000000..647483f --- /dev/null +++ b/src/types.h @@ -0,0 +1,8 @@ + +#pragma once + +typedef uint8_t u8; +typedef int32_t i32; +typedef uint32_t u32; +typedef uint64_t u64; +