aboutsummaryrefslogtreecommitdiff
path: root/graphics.c
diff options
context:
space:
mode:
Diffstat (limited to 'graphics.c')
-rw-r--r--graphics.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/graphics.c b/graphics.c
index 4b3e3d3..af5e955 100644
--- a/graphics.c
+++ b/graphics.c
@@ -2,6 +2,7 @@
#include "array.h"
#include "config.h"
#include "shader.h"
+#include "font.h"
void GLAPIENTRY
MessageCallback(GLenum source,
@@ -203,8 +204,8 @@ void render_frame(client_state *state) {
glUseProgram(state->box_shader);
glUniform4f(state->b_color_uniform, cursor_color.r,cursor_color.g,cursor_color.b,cursor_color.a);
glUniform2f(state->b_screen_size_uniform, state->width, state->height);
- glUniform2f(state->b_start_uniform, state->input_buffer_grafix.pixel_len + state->horizontal_spacing / 2.0f, input_y);
- glUniform2f(state->b_size_uniform, state->atlas.metrics['m'].bitmap_width, state->line_height);
+ glUniform2f(state->b_start_uniform, atlas_get_strwidth_len(state, state->input_buffer, state->cursor_index) + state->horizontal_spacing / 2.0f, input_y);
+ glUniform2f(state->b_size_uniform, state->atlas.metrics['M'].bitmap_width, state->line_height);
glDrawArrays(GL_TRIANGLES, 0, 6);
float start;