From 37a9f55ecd39f99aa800adc875555ecd613722c4 Mon Sep 17 00:00:00 2001 From: 0scar Date: Thu, 1 Feb 2024 22:27:06 +0100 Subject: Fixme! --- include/engine/engine.h | 11 ++++++----- include/engine/input.h | 1 - include/engine/rendering.h | 13 ++++++++++++- 3 files changed, 18 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/engine/engine.h b/include/engine/engine.h index 6943538..4a1b6e3 100644 --- a/include/engine/engine.h +++ b/include/engine/engine.h @@ -52,6 +52,8 @@ typedef struct { usize bindings_sz; usize bindings_len; + struct RenderObject *testobject; + binding_t bindings_global[NUM_GLOBAL_BINDINGS]; } Platform; @@ -85,12 +87,12 @@ void engine_input_ctx_reset(void); #ifdef ENGINE_INTERNALS -#define MAX(a, b) (a > b ? a : b) +#define GLFW_INCLUDE_NONE +#include /* Window */ struct Window { - SDL_Window* window; - SDL_Renderer* renderer; + GLFWwindow* window; f32 render_scale; v2_i32 windowsize; @@ -100,7 +102,6 @@ struct Window { }; typedef struct { - SDL_Texture* texture; const i32 tilesize; const i32 width; const i32 height; @@ -120,7 +121,7 @@ struct Resources { /* Our actual sources */ Texture** textures; - TTF_Font** fonts; + //TTF_Font** fonts; }; #endif diff --git a/include/engine/input.h b/include/engine/input.h index c93d74d..49b3a96 100644 --- a/include/engine/input.h +++ b/include/engine/input.h @@ -35,7 +35,6 @@ typedef struct binding_t { action_t action; // Change type depending on input handling back-end. like u16 for GLFW_KEY - // enum SDL_Scancode keycode; scancode_t scancode; scancode_t scancode_alt; diff --git a/include/engine/rendering.h b/include/engine/rendering.h index cfd9679..00f389e 100644 --- a/include/engine/rendering.h +++ b/include/engine/rendering.h @@ -22,6 +22,7 @@ typedef struct { v2_i32 coord; } Sprite; + #include "engine.h" #include "ui.h" @@ -49,6 +50,10 @@ Sprite sprite_new(u64 tid, u8 coord); #ifdef ENGINE_INTERNALS #include "engine.h" +//#include +//#define GLFW_INCLUDE_NONE +//#include + #define TEXTURES_INCREMENT 512 typedef enum { @@ -67,11 +72,17 @@ typedef struct { i32 x; i32 y; f32 scale; - SDL_Color mod; } sprite; } data; } RenderDrawCall; +struct RenderObject { + u32 vao; + u32 vbo; + u32 shaderprogram; + f32 g_vertex_buffer_data[9]; +}; + void render_uitree(Window* w, UITree* t); void render_container(Window* w, UITree_container* t); -- cgit v1.3