From 74674101bb45931748e084cc647cfb84f7609a6d Mon Sep 17 00:00:00 2001 From: 0scar Date: Mon, 5 Feb 2024 09:03:07 +0100 Subject: Rotating box example --- src/rendering.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/rendering.c') 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; -- cgit v1.3