summaryrefslogtreecommitdiff
path: root/src/rendering.c
diff options
context:
space:
mode:
author0scar <qgt268@alumni.ku.dk>2024-02-05 08:03:07 +0000
committer0scar <qgt268@alumni.ku.dk>2024-02-05 12:02:19 +0000
commit74674101bb45931748e084cc647cfb84f7609a6d (patch)
tree6c06c84c8234194bdeb340f18ea6e18214151359 /src/rendering.c
parentd1fe7e56d12dea3a123d1ad610de4de88abcba13 (diff)
Rotating box example
Diffstat (limited to 'src/rendering.c')
-rw-r--r--src/rendering.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rendering.c b/src/rendering.c
index 06c14e8..dff3432 100644
--- a/src/rendering.c
+++ b/src/rendering.c
@@ -28,7 +28,7 @@ i32 drawcall_len = 0;
void render_begin(Window* w) {
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glfwMakeContextCurrent(w->window);
- w->context->Clear(GL_COLOR_BUFFER_BIT);
+ w->context->Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
void render_present(Window* w) {
@@ -69,6 +69,14 @@ void render_present(Window* w) {
void drawcall_reset(void) { drawcall_len = 0; }
+void window_size_callback(GLFWwindow* window, int width, int height) {
+ GLOBAL_PLATFORM->window->context->Viewport(0,0, width, height);
+ //*GLOBAL_PLATFORM->window->game_w = width;
+ //*GLOBAL_PLATFORM->window->game_h = height;
+ GLOBAL_PLATFORM->window->windowsize.x = width;
+ GLOBAL_PLATFORM->window->windowsize.y = height;
+}
+
void engine_window_resize_pointers(i32* w, i32* h) {
GLOBAL_PLATFORM->window->game_w = w;
GLOBAL_PLATFORM->window->game_h = h;