summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/engine/engine.h11
-rw-r--r--include/engine/input.h1
-rw-r--r--include/engine/rendering.h13
3 files changed, 18 insertions, 7 deletions
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 <GLFW/glfw3.h>
/* 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 <glad/gl.h>
+//#define GLFW_INCLUDE_NONE
+//#include <GLFW/glfw3.h>
+
#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);