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>
|
|
|
|
|
2023-10-15 08:07:33 +00:00
|
|
|
#include <assets.h>
|
|
|
|
#include <shaders.h>
|
|
|
|
#include <entity.h>
|
|
|
|
#include <blocks.h>
|
|
|
|
#include <world.h>
|
|
|
|
#include <utility/utility.h>
|
2023-10-10 18:01:15 +00:00
|
|
|
|
|
|
|
typedef struct tc_camera
|
|
|
|
{
|
2023-10-15 08:07:33 +00:00
|
|
|
tc_vec3f_s position;
|
|
|
|
tc_vec3f_s rotation;
|
2023-10-10 18:01:15 +00:00
|
|
|
float fov;
|
|
|
|
|
|
|
|
} tc_camera_s;
|
|
|
|
|
|
|
|
typedef struct tc_renderer
|
|
|
|
{
|
2023-10-14 14:38:38 +00:00
|
|
|
tc_camera_s *active_camera;
|
2023-10-10 18:01:15 +00:00
|
|
|
tc_shader_program_s draw_shader;
|
|
|
|
|
|
|
|
SDL_Window *window;
|
|
|
|
SDL_GLContext gl_context;
|
|
|
|
|
|
|
|
} tc_renderer_s;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
tc_renderer_s renderer;
|
2023-10-11 13:01:54 +00:00
|
|
|
tc_asset_storage_s asset_storage;
|
2023-10-10 19:23:07 +00:00
|
|
|
tc_block_registry_s block_registry;
|
2023-10-14 13:04:52 +00:00
|
|
|
tc_entity_registry_s entity_registry;
|
2023-10-12 16:52:05 +00:00
|
|
|
tc_world_s *main_world;
|
2023-10-14 14:38:38 +00:00
|
|
|
tc_entity_s *viewer;
|
|
|
|
tc_entity_s *player;
|
2023-10-10 18:01:15 +00:00
|
|
|
|
2023-10-14 19:17:30 +00:00
|
|
|
uint16_t fps;
|
|
|
|
uint16_t tps;
|
|
|
|
|
2023-10-11 13:01:54 +00:00
|
|
|
tc_image_s *block_texture_atlas;
|
|
|
|
|
2023-10-10 18:01:15 +00:00
|
|
|
} techneck_s;
|
|
|
|
|
|
|
|
extern techneck_s tc_game_state_g;
|
|
|
|
|
2023-10-12 06:18:43 +00:00
|
|
|
void tc_init ();
|
|
|
|
void tc_cleanup ();
|
|
|
|
|
|
|
|
void tc_load_textures ();
|
2023-10-10 18:01:15 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|