diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2025-10-17 18:21:51 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2025-10-17 18:21:51 -0400 |
| commit | ec8c94dc43db11c79ef58b212cacfadec09bb59c (patch) | |
| tree | dac513e9acb40b2d6f606031bb4d9299e2e8c423 /graphics.c | |
| parent | 7abba4bd6aea943870bfd571866e36a6167c80a2 (diff) | |
lines argument
Diffstat (limited to 'graphics.c')
| -rw-r--r-- | graphics.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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 |
