Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::core::OpenGL Class Reference

OpenGL renderer. More...

#include <OxygenEngine/core/renderer/opengl.h>

+ Inheritance diagram for oe::core::OpenGL:
+ Collaboration diagram for oe::core::OpenGL:

Public Member Functions

 OpenGL (Window *context_holder)
 Constructor.
 
void resizeViewport (const int32_t x, const int32_t y, const int32_t width, const int32_t height)
 Resize screen viewport.
 
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.
 
std::shared_ptr< render::ScreenQuadgetScreenQuad ()
 Get a screen covering quad render mesh for screen rendering.
 
const WindowgetWindow () const noexcept
 Get a reference to the Window bound to the context.
 
void bindContextToWindow (Window &window)
 Bind the OpenGL to a Window.
 

Static Public Member Functions

static OpenGLgetInstance ()
 Get the OpenGL instance related to this thread.
 
static bool hasContext ()
 Check if this thread has an OpenGL context.
 

Protected Attributes

std::shared_ptr< render::ScreenQuad_screen_quad
 Mesh covering whole screen mainly used for post-processing.
 

Detailed Description

OpenGL renderer.

Note
Should extends Renderer

Constructor & Destructor Documentation

◆ OpenGL()

oe::core::OpenGL::OpenGL ( Window context_holder)

Constructor.

Parameters
context_holderWindow to bind to this context

Member Function Documentation

◆ bindContextToWindow()

void oe::core::OpenGL::bindContextToWindow ( Window window)

Bind the OpenGL to a Window.

Parameters
windowThe Window to bind

◆ getInstance()

static OpenGL * oe::core::OpenGL::getInstance ( )
inlinestatic

Get the OpenGL instance related to this thread.

Returns
OpenGL instance related to this thread or null if no one has been init

◆ getScreenQuad()

std::shared_ptr< render::ScreenQuad > oe::core::OpenGL::getScreenQuad ( )
inline

Get a screen covering quad render mesh for screen rendering.

Returns
Pointer to the screen quad

◆ getWindow()

const Window & oe::core::OpenGL::getWindow ( ) const
inlinenoexcept

Get a reference to the Window bound to the context.

Returns
Window bound to the context

◆ hasContext()

static bool oe::core::OpenGL::hasContext ( )
inlinestatic

Check if this thread has an OpenGL context.

Returns
true if this thread has an OpenGL context

◆ resizeViewport()

void oe::core::OpenGL::resizeViewport ( const int32_t  x,
const int32_t  y,
const int32_t  width,
const int32_t  height 
)

Resize screen viewport.

Parameters
xLower left corner x value of the viewport rectangle, in pixels
yLower left corner y value of the viewport rectangle, in pixels
widthviewport width, in pixels
heightviewport height, in pixels

◆ scissor()

void oe::core::OpenGL::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.

Parameters
xLower left corner x value of the scissor rectangle, in pixels
yLower left corner y value of the scissor rectangle, in pixels
widthscissor width, in pixels
heightscissor height, in pixels

The documentation for this class was generated from the following file: