2023-09-12 03:21:18 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2023-09-15 23:47:43 +02:00
|
|
|
#include "cudoku.h"
|
2023-09-12 03:21:18 +02:00
|
|
|
#include "shader.h"
|
|
|
|
|
|
|
|
|
|
typedef struct Size {
|
|
|
|
|
int width;
|
|
|
|
|
int height;
|
|
|
|
|
} Size;
|
|
|
|
|
|
|
|
|
|
typedef struct Character {
|
|
|
|
|
unsigned int texture_id;
|
|
|
|
|
Size size;
|
|
|
|
|
Size bearing;
|
|
|
|
|
unsigned int advance;
|
|
|
|
|
} Character;
|
|
|
|
|
|
|
|
|
|
int init_fonts(const char *font_path);
|
|
|
|
|
void prepare_font(unsigned int *vao, unsigned int *vbo);
|
|
|
|
|
Size calculate_text_size(const char *text, float scale);
|
2023-09-15 23:47:43 +02:00
|
|
|
void draw_number(Shader shader, Cell cell, int row, int column, float scale,unsigned int vao, unsigned int vbo, float* transform);
|
2023-11-17 06:16:32 +02:00
|
|
|
void draw_text_center(Shader shader, const char *text, Size text_size, float scale, unsigned int vao, unsigned int vbo, float *transform, float offset_x, float offset_y);
|
|
|
|
|
void draw_text_at(Shader shader, const char *text, Vec2 pos, float scale, unsigned int vao, unsigned int vbo, float *projection, Color *color);
|