From ec8c94dc43db11c79ef58b212cacfadec09bb59c Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Fri, 17 Oct 2025 18:21:51 -0400 Subject: lines argument --- graphics.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'graphics.c') diff --git a/graphics.c b/graphics.c index f8b85ea..d4fcb10 100644 --- a/graphics.c +++ b/graphics.c @@ -128,19 +128,15 @@ void render_frame(client_state *state) { glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - // draw text + // bind vertex and texture glBindVertexArray(state->input_buffer_text.vao); glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, state->atlas.texture); + // bind shader and draw glUseProgram(state->text_shader); glUniform2f(state->screen_size_uniform, state->width, state->height); - glUniform2f(state->offset_uniform, 0.0f, 0.0f); - glDrawElements(GL_TRIANGLES, state->input_buffer_text.num_elements, GL_UNSIGNED_INT, 0); - - // draw second text a line higher - glUniform2f(state->offset_uniform, 0.0f, state->line_height); + glUniform2f(state->offset_uniform, 0.0f, state->line_height * (state->lines + 0.15f)); glDrawElements(GL_TRIANGLES, state->input_buffer_text.num_elements, GL_UNSIGNED_INT, 0); // present screen -- cgit v1.2.3