A small OpenGL 3+ renderer and game engine
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.
 
 
 

59 lines
1.1 KiB

#pragma once
#include <vector>
#if defined (_WIN32)
#include <SDL.h>
#else
#include <SDL2/SDL.h>
#endif
#include <GL/glew.h>
#include <glm/glm.hpp>
#include "camera.h"
#include "entity.h"
#include "render_group.h"
#include "util.h"
struct SDL_Handles
{
SDL_Window *window;
SDL_GLContext glContext;
SDL_DisplayMode currentDisplayMode;
std::vector<SDL_Surface*> texSurfaces;
};
struct rg_point_light;
struct render_state
{
v2i viewport_dims;
bool is_debug_draw;
SDL_Handles handles;
camera cam;
util_image palette_image;
// TODO: this needs to be initialized outside struct because calloc
GLuint palette_id = UINT_MAX;
util_RGBA clear_col;
render_group* filled_hex_render_group;
render_group* hex_line_render_group;
render_group* debug_render_group;
// NOTE: entity render groups are stored on the entity object
rg_shader_program default_shader;
rg_point_light* lights;
uint num_lights;
uint max_lights;
};
render_state* renInit();
void renFreeBuffers(render_state* rs);
void renRenderFrame(render_state* rs, Entity* entities, uint32 entity_count);
//void renRenderDebug(render_state* rs, std::vector<Point> &vertices);