2#ifdef StevEngine_RENDERER_GL
4#include "utilities/Color.hpp"
5#include "visuals/shaders/Shader.hpp"
6#include "visuals/shaders/ShaderProgram.hpp"
74 void Init(SDL_Window* window);
114 void SetFaceCulling(
bool enable, GLenum face = GL_FRONT,
bool clockwise =
false);
115 void SetMSAA(
bool enable, uint16_t amount = 4);
118 void SetEnabled(
bool enabled);
119 private:
bool enabled;
123 const ShaderProgram& GetDefaultVertexShaderProgram()
const {
return vertexShaderProgram; }
124 const ShaderProgram& GetDefaultFragmentShaderProgram()
const {
return fragmentShaderProgram; }
125 uint32_t GetShaderPipeline()
const {
return shaderPipeline; }
127 float GetAmbientLightStrength()
const {
return ambientLightStrength; }
141 std::vector<Visuals::Light*>
GetLights()
const {
return lights; }
161 SDL_GLContext context;
169 uint32_t shaderPipeline;
178 std::vector<Visuals::Light*> lights;
180 float ambientLightStrength;
183 extern RenderSystem
render;
Base interface for renderable objects.
Definition Object.hpp:21
Core rendering system.
Definition RenderSystem.hpp:68
void SetMSAA(bool enable, uint16_t amount=4)
Set anti-aliasing.
Definition RenderSystem.cpp:126
void DrawObject(const CustomObject &object, Utilities::Matrix4 transform, RenderQueue queue=STANDARD)
Queue object for rendering.
Definition RenderSystem.cpp:181
void ResetGlobalShader(ShaderType type)
Reset global shader to default.
Definition RenderSystem.cpp:141
static const Uint32 WindowType()
Get SDL window flags.
Definition RenderSystem.cpp:28
void AddGlobalShader(ShaderProgram shader)
Add global shader program.
Definition RenderSystem.cpp:158
void SetFaceCulling(bool enable, GLenum face=GL_FRONT, bool clockwise=false)
Set face culling.
Definition RenderSystem.cpp:116
void AddLight(Visuals::Light *light)
Add light to scene.
Definition RenderSystem.cpp:257
void SetVSync(bool vsync)
Set vertical sync.
Definition RenderSystem.cpp:112
void SetViewSize(int WIDTH, int HEIGHT)
Set viewport size.
Definition RenderSystem.cpp:108
void DrawFrame()
Draw a complete frame.
Definition RenderSystem.cpp:185
std::vector< Visuals::Light * > GetLights() const
Get all active lights.
Definition RenderSystem.hpp:141
void SetBackground(const Utilities::Color &color)
Set background clear color.
Definition RenderSystem.cpp:232
void SetAmbientLight(float strength, const Utilities::Color &color=Utilities::Color(255, 255, 255, 255))
Set ambient light properties.
Definition RenderSystem.cpp:236
uint32_t GetLightID(std::string type)
Get next available light ID for type.
Definition RenderSystem.cpp:243
void ResetGPUBuffers()
Rebinds the GPU buffers (VBO, EBO, VAO) to the renderers.
Definition RenderSystem.cpp:175
void RemoveLight(Visuals::Light *light)
Remove light from scene.
Definition RenderSystem.cpp:261
void Init(SDL_Window *window)
Initialize rendering system.
Definition RenderSystem.cpp:48
Compiled and linked shader program.
Definition ShaderProgram.hpp:22
4x4 matrix for 3D transformations
Definition Matrix4.hpp:12
Base class for light components.
Definition Lights.hpp:18
Core rendering system.
Definition Object.cpp:19
RenderQueue
Render queue types for sorting objects.
Definition RenderSystem.hpp:55
@ OVERLAY
UI and overlay objects.
Definition RenderSystem.hpp:58
@ STANDARD
Default opaque objects.
Definition RenderSystem.hpp:56
@ MUST_BE_LAST
Queue count marker.
Definition RenderSystem.hpp:59
@ TRANSPARENT
Transparent objects.
Definition RenderSystem.hpp:57
RenderSystem render
Global render system instance.
Definition RenderSystem.cpp:26
const CustomObject & object
Object to render.
Definition RenderSystem.hpp:34
const Utilities::Matrix4 transform
World transform matrix.
Definition RenderSystem.hpp:35
RenderObject(const CustomObject &object, const Utilities::Matrix4 &transform)
Create render object.
Definition RenderSystem.hpp:42
void Draw()
Draw the object.
Definition RenderSystem.hpp:47
RGBA color representation.
Definition Color.hpp:12