KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::OpenGLContext Class Reference

OpenGL API based implementation of GraphicsContext. More...

#include <OpenGLContext.h>

Inheritance diagram for Karma::OpenGLContext:
Collaboration diagram for Karma::OpenGLContext:

Public Member Functions

 OpenGLContext (GLFWwindow *windowHandle)
 A constructor.
 
virtual void Init () override
 Initializes the context.
 
virtual void SwapBuffers () override
 This function swaps the front and back buffers of the context window.
 
virtual bool OnWindowResize (WindowResizeEvent &event) override
 Called by Window::Resize, when the resize of a window happens.
 
- Public Member Functions inherited from Karma::GraphicsContext
virtual ~GraphicsContext ()
 A destructor.
 

Detailed Description

OpenGL API based implementation of GraphicsContext.

Since
Karma 1.0.0

Constructor & Destructor Documentation

◆ OpenGLContext()

Karma::OpenGLContext::OpenGLContext ( GLFWwindow * windowHandle)

A constructor.

Sets the glfw window handle and null asserts

Parameters
windowHandleThe window handle to be set to, in the context
Since
Karma 1.0.0

Member Function Documentation

◆ Init()

void Karma::OpenGLContext::Init ( )
overridevirtual

Initializes the context.

Loads Glad

Since
Karma 1.0.0

Implements Karma::GraphicsContext.

◆ OnWindowResize()

bool Karma::OpenGLContext::OnWindowResize ( WindowResizeEvent & event)
overridevirtual

Called by Window::Resize, when the resize of a window happens.

Parameters
eventThe details of the resizing event
Since
Karma 1.0.0

Implements Karma::GraphicsContext.

◆ SwapBuffers()

void Karma::OpenGLContext::SwapBuffers ( )
overridevirtual

This function swaps the front and back buffers of the context window.

Note
If the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before swapping the buffers.
Since
Karma 1.0.0

Implements Karma::GraphicsContext.


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