You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.2 KiB
57 lines
1.2 KiB
|
|
#pragma once |
|
|
|
#include <vector> |
|
|
|
#if defined (_WIN32) |
|
#include <SDL.h> |
|
#else |
|
#include <SDL2/SDL.h> |
|
#endif |
|
#include <glm/glm.hpp> |
|
|
|
#include "camera.h" |
|
#include "entity.h" |
|
#include "hexgrid.h" |
|
#include "util.h" |
|
|
|
|
|
struct SDL_Handles |
|
{ |
|
SDL_Window *window; |
|
SDL_GLContext glContext; |
|
SDL_DisplayMode currentDisplayMode; |
|
std::vector<SDL_Surface*> texSurfaces; |
|
}; |
|
|
|
struct render_state |
|
{ |
|
v2i viewport_dims; |
|
bool is_debug_draw; |
|
uint32 fill_color; |
|
uint32 selected_fill_color; |
|
}; |
|
|
|
struct renPointLight |
|
{ |
|
glm::vec3 position; |
|
glm::vec3 direction; |
|
glm::vec3 color; |
|
float intensity; |
|
|
|
uint light_ID; |
|
}; |
|
|
|
bool initRenderer(SDL_Handles &handles, v2i vpDims); |
|
bool addTexture(SDL_Handles &handles, const char * path); |
|
camera& renGetCamera(); |
|
v2f getUnprojectedCoords(int32 x, int32 y, int32 vp_width, int32 vp_height); |
|
v3f getCameraPosition(); |
|
bool createScene(std::vector<hex_info>* hexes, Entity* entities, uint32 entity_count); |
|
void moveCamera(bool up, bool left, bool down, bool right, bool forward, bool backward); |
|
void rollCamera(bool CW, bool CCW); |
|
void rotateCamera(int32 xrel, int32 yrel); |
|
void renderFrame(std::vector<hex_info> *hexes, Entity* entities, uint32 entity_count); |
|
void renderDebug(std::vector<Point> &vertices); |
|
void freeBuffers(); |
|
|
|
|