Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Ra::Headless::OpenGLContext Class Referenceabstract

#include <Headless/OpenGLContext/OpenGLContext.hpp>

+ Collaboration diagram for Ra::Headless::OpenGLContext:

Public Types

enum class  EventMode : int { POLL = 0 , WAIT , TIMEOUT , NUM_MODES }
 

Public Member Functions

 OpenGLContext (const glbinding::Version &={ 4, 1 }, const std::array< int, 2 > &={ { 1, 1 } })
 
virtual ~OpenGLContext ()=default
 destructor
 
virtual void makeCurrent () const =0
 make the context active
 
virtual void doneCurrent () const =0
 make the context inactive
 
virtual bool isValid () const =0
 Check for validity of the context.
 
virtual bool isWindow () const
 Check if the context is associated to a window.
 
virtual std::string getInfo () const
 Return a string identifying the openGL Context and its supported versions.
 
virtual void show (EventMode, float)
 Show the window.
 
virtual void hide ()
 Hide the window.
 
virtual void resize (const std::array< int, 2 > &)
 Resize the window.
 
virtual void renderLoop (std::function< void(float)>)
 loop on events and execute the functor render after each event
 
Ra::Core::Utils::Observable< int, int > & resizeListener ()
 
Ra::Core::Utils::Observable< int, int, int, int > & keyboardListener ()
 
Ra::Core::Utils::Observable< int, int, int, int, int > & mouseListener ()
 
Ra::Core::Utils::Observable< int, int > & mouseMoveListener ()
 
Ra::Core::Utils::Observable< int, int > & scrollListener ()
 

Protected Member Functions

virtual bool processEvents ()
 Process the pending events according to the window show mode.
 
void resizeFrameBuffer (int width, int height)
 Resize callback.
 
void keyboardEventCallback (int key, int scancode, int action, int mods)
 Keyboard callback.
 
void mouseEventCallback (int button, int action, int mods, int x, int y)
 Mouse callback.
 
void mouseMoveEventCallback (int x, int y)
 Mouse move callback.
 
void scrollEventCallback (int xoffset, int yoffset)
 Scroll callback.
 

Protected Attributes

Ra::Core::Utils::Observable< int, int > m_resizers
 Resize event observable.
 
Ra::Core::Utils::Observable< int, int, int, int > m_keyboardObservers
 Keyboard event observable.
 
Ra::Core::Utils::Observable< int, int, int, int, int > m_mouseObservers
 Mouse event observable.
 
Ra::Core::Utils::Observable< int, int > m_mouseMoveObservers
 Mouse move event observable.
 
Ra::Core::Utils::Observable< int, int > m_scrollObservers
 Scroll event observable.
 
EventMode m_mode { EventMode::POLL }
 Event processing mode.
 
float m_delay { 1.f / 60.f }
 Timeout delay for event processing.
 

Detailed Description

This class defines the interface for any off-screen OpenGL Context. There are two use cases of such a context :

  • headless rendering application.
  • simple window with limited interaction for context providers supporting windows

Definition at line 22 of file OpenGLContext.hpp.


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