Files
cudoku/cudoku.h
T

31 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include <stdbool.h>
#include "shader.h"
2023-09-12 23:32:58 +02:00
typedef struct Vec2 {
int x;
int y;
} Vec2;
typedef struct Cudoku {
int board[9][9];
bool has_won;
Vec2 selection;
bool should_draw_selection;
} Cudoku;
void set_scale_factor(int width, int height, float *x, float *y);
2023-09-12 03:21:18 +02:00
unsigned int prepare_bg(bool use_texture, unsigned int *texture);
void draw_bg_grid_shader(Shader shader, unsigned int vao, float* transform, float resolution);
void draw_bg_grid_texture(Shader shader, unsigned int vao, unsigned int texture, float* transform);
void draw_numbers(Shader shader, unsigned int vao, unsigned int vbo, float *transform, int board[9][9]);
void draw_win_overlay(Shader shader, unsigned int vao, unsigned int vbo, float *transform);
2023-09-12 23:32:58 +02:00
void prepare_selection_box(unsigned int *vao, unsigned int *vbo);
void draw_selection_box(Shader shader, unsigned int vao, unsigned int vbo, int x, int y, float *transform);
void do_selection(Cudoku *game, int x, int y, int width, int height, float x_scale, float y_scale);
void set_selected_number(Cudoku *game, int number);
void move_selection(Cudoku *game, int x, int y);
void toggle_selection(Cudoku *game);