1#ifndef OE_CORE_RENDERER_OPENGL_H
2#define OE_CORE_RENDERER_OPENGL_H
4#include "../../common.h"
5#include "../../lib/gl3w.h"
6#include "../../util/non_copyable.h"
46 void resizeViewport(
const int32_t x,
const int32_t y,
const int32_t width,
const int32_t height);
57 void scissor(uint32_t x, uint32_t y, uint32_t width, uint32_t height);
66 assert(_instance !=
nullptr);
88 return _instance !=
nullptr;
98 return *_context_holder;
108 #ifdef OXYGEN_ENGINE_OPENGL_DEBUG_OUTPUT
109 static void APIENTRY debugCallback(
116 const void* userParam
128 thread_local static OpenGL* _instance;
130 Window* _context_holder =
nullptr;
OpenGL renderer.
Definition opengl.h:24
static OpenGL * getInstance()
Get the OpenGL instance related to this thread.
Definition opengl.h:76
void scissor(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
Define the scissor area Only allow draws in this area, other draw calls are discarded.
void resizeViewport(const int32_t x, const int32_t y, const int32_t width, const int32_t height)
Resize screen viewport.
std::shared_ptr< render::ScreenQuad > getScreenQuad()
Get a screen covering quad render mesh for screen rendering.
Definition opengl.h:64
OpenGL(Window *context_holder)
Constructor.
void bindContextToWindow(Window &window)
Bind the OpenGL to a Window.
static bool hasContext()
Check if this thread has an OpenGL context.
Definition opengl.h:86
std::shared_ptr< render::ScreenQuad > _screen_quad
Mesh covering whole screen mainly used for post-processing.
Definition opengl.h:124
const Window & getWindow() const noexcept
Get a reference to the Window bound to the context.
Definition opengl.h:96
Definition screen_quad.h:10
Prevent class to be copied.
Definition non_copyable.h:12
Core functionality (windows, event handler, logger, ...)
Definition cursor.h:8
Render related abstractions (Shader, Framebuffer, Cubemaps, Textures)
Definition opengl.h:10