From 7f2c79d77de931d38d5359ba836f5b6dd77fdcc2 Mon Sep 17 00:00:00 2001 From: Riley Beckett Date: Thu, 16 Oct 2025 11:39:41 -0400 Subject: fix viewport --- graphics.c | 3 ++- main.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/graphics.c b/graphics.c index 5bf1bf1..86b22d4 100644 --- a/graphics.c +++ b/graphics.c @@ -123,6 +123,7 @@ bool init_gl(client_state* state) { } void render_frame(client_state *state) { + glViewport(0, 0, state->width, state->height); glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -135,7 +136,7 @@ void render_frame(client_state *state) { glUseProgram(state->text_shader); glUniform2f(state->screen_size_uniform, state->width, state->height); - glUniform2f(state->offset_uniform, 200.0f, 200.0f); + glUniform2f(state->offset_uniform, 0.0f, 0.0f); glDrawElements(GL_TRIANGLES, state->input_buffer_text.num_elements, GL_UNSIGNED_INT, 0); eglSwapBuffers(state->egl_display, state->egl_surface); diff --git a/main.c b/main.c index acc328d..13a6328 100644 --- a/main.c +++ b/main.c @@ -74,7 +74,7 @@ int main() { // create font altas textures atlas_create_texture(&state); - initTextBuffer(&state, &state.input_buffer_text, "this is a test", strlen("this is a test")); + initTextBuffer(&state, &state.input_buffer_text, "this is a gtest", strlen("this is a gtest")); // event loop while (state.running) { -- cgit v1.2.3