aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiley Beckett <rbeckettvt@gmail.com>2025-10-16 11:39:41 -0400
committerRiley Beckett <rbeckettvt@gmail.com>2025-10-16 11:39:41 -0400
commit7f2c79d77de931d38d5359ba836f5b6dd77fdcc2 (patch)
tree89f3b965631651918a875e3a4ad9e1a57b4a3a86
parentab4b6df33f1f07c49996bc6a770d387a3a71e6c7 (diff)
fix viewport
-rw-r--r--graphics.c3
-rw-r--r--main.c2
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) {