2023-10-10 18:01:15 +00:00
|
|
|
|
|
|
|
#ifndef TC_STATE_H
|
|
|
|
#define TC_STATE_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
|
|
|
|
#include "shaders.h"
|
2023-10-10 19:23:07 +00:00
|
|
|
#include "blocks.h"
|
2023-10-10 18:01:15 +00:00
|
|
|
|
|
|
|
typedef struct tc_vec3
|
|
|
|
{
|
|
|
|
float x;
|
|
|
|
float y;
|
|
|
|
float z;
|
|
|
|
|
|
|
|
} tc_vec3_s;
|
|
|
|
|
|
|
|
typedef struct tc_object
|
|
|
|
{
|
|
|
|
uint32_t vbo;
|
|
|
|
uint32_t vao;
|
|
|
|
tc_vec3_s position;
|
|
|
|
tc_vec3_s rotation;
|
|
|
|
|
|
|
|
} tc_object_s;
|
|
|
|
|
|
|
|
typedef struct tc_block
|
|
|
|
{
|
|
|
|
tc_vec3_s position;
|
|
|
|
tc_object_s drawing;
|
|
|
|
|
|
|
|
} tc_block_s;
|
|
|
|
|
|
|
|
typedef struct tc_camera
|
|
|
|
{
|
|
|
|
tc_vec3_s position;
|
|
|
|
tc_vec3_s rotation;
|
|
|
|
float fov;
|
|
|
|
|
|
|
|
} tc_camera_s;
|
|
|
|
|
|
|
|
typedef struct tc_renderer
|
|
|
|
{
|
|
|
|
tc_camera_s active_camera;
|
|
|
|
tc_shader_program_s draw_shader;
|
|
|
|
|
|
|
|
SDL_Window *window;
|
|
|
|
SDL_GLContext gl_context;
|
|
|
|
|
|
|
|
} tc_renderer_s;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
tc_renderer_s renderer;
|
2023-10-10 19:23:07 +00:00
|
|
|
tc_block_registry_s block_registry;
|
2023-10-10 18:01:15 +00:00
|
|
|
|
|
|
|
} techneck_s;
|
|
|
|
|
|
|
|
extern techneck_s tc_game_state_g;
|
|
|
|
|
|
|
|
techneck_s tc_init ();
|
|
|
|
void tc_cleanup ();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|