Blender  V3.3
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
GHOST_Context Class Referenceabstract

#include <GHOST_Context.h>

Inheritance diagram for GHOST_Context:
GHOST_IContext GHOST_ContextCGL GHOST_ContextD3D GHOST_ContextEGL GHOST_ContextGLX GHOST_ContextNone GHOST_ContextSDL GHOST_ContextWGL

Public Member Functions

 GHOST_Context (bool stereoVisual)
 
virtual ~GHOST_Context ()
 
virtual GHOST_TSuccess swapBuffers ()=0
 
virtual GHOST_TSuccess activateDrawingContext ()=0
 
virtual GHOST_TSuccess releaseDrawingContext ()=0
 
virtual GHOST_TSuccess initializeDrawingContext ()=0
 
virtual GHOST_TSuccess updateDrawingContext ()
 
virtual GHOST_TSuccess releaseNativeHandles ()=0
 
virtual GHOST_TSuccess setSwapInterval (int)
 
virtual GHOST_TSuccess getSwapInterval (int &)
 
voidgetUserData ()
 
void setUserData (void *user_data)
 
bool isStereoVisual () const
 
virtual bool isUpsideDown () const
 
virtual unsigned int getDefaultFramebuffer ()
 
- Public Member Functions inherited from GHOST_IContext
virtual ~GHOST_IContext ()
 

Protected Member Functions

void initContextGLEW ()
 

Static Protected Member Functions

static void initClearGL ()
 

Protected Attributes

bool m_stereoVisual
 
voidm_user_data = nullptr
 

Detailed Description

Definition at line 18 of file GHOST_Context.h.

Constructor & Destructor Documentation

◆ GHOST_Context()

GHOST_Context::GHOST_Context ( bool  stereoVisual)
inline

Constructor.

Parameters
stereoVisualStereo visual for quad buffered stereo.

Definition at line 24 of file GHOST_Context.h.

◆ ~GHOST_Context()

virtual GHOST_Context::~GHOST_Context ( )
inlinevirtual

Destructor.

Definition at line 31 of file GHOST_Context.h.

Member Function Documentation

◆ activateDrawingContext()

virtual GHOST_TSuccess GHOST_Context::activateDrawingContext ( )
pure virtual

Activates the drawing context of this window.

Returns
A boolean success indicator.

Implements GHOST_IContext.

Implemented in GHOST_ContextWGL, GHOST_ContextSDL, GHOST_ContextNone, GHOST_ContextGLX, GHOST_ContextEGL, GHOST_ContextD3D, and GHOST_ContextCGL.

Referenced by GHOST_Window::activateDrawingContext().

◆ getDefaultFramebuffer()

virtual unsigned int GHOST_Context::getDefaultFramebuffer ( )
inlinevirtual

Gets the OpenGL frame-buffer associated with the OpenGL context

Returns
The ID of an OpenGL frame-buffer object.

Implements GHOST_IContext.

Reimplemented in GHOST_ContextD3D, and GHOST_ContextCGL.

Definition at line 133 of file GHOST_Context.h.

Referenced by GHOST_Window::getDefaultFramebuffer().

◆ getSwapInterval()

virtual GHOST_TSuccess GHOST_Context::getSwapInterval ( int &  )
inlinevirtual

Gets the current swap interval for swapBuffers.

Parameters
intervalOutVariable to store the swap interval if it can be read.
Returns
Whether the swap interval can be read.

Reimplemented in GHOST_ContextWGL, GHOST_ContextSDL, GHOST_ContextNone, GHOST_ContextGLX, GHOST_ContextEGL, GHOST_ContextD3D, and GHOST_ContextCGL.

Definition at line 90 of file GHOST_Context.h.

References GHOST_kFailure.

Referenced by GHOST_Window::getSwapInterval().

◆ getUserData()

void* GHOST_Context::getUserData ( )
inline

Get user data.

Definition at line 98 of file GHOST_Context.h.

References m_user_data.

◆ initClearGL()

void GHOST_Context::initClearGL ( )
staticprotected

◆ initContextGLEW()

void GHOST_Context::initContextGLEW ( )
protected

◆ initializeDrawingContext()

virtual GHOST_TSuccess GHOST_Context::initializeDrawingContext ( )
pure virtual

Call immediately after new to initialize. If this fails then immediately delete the object.

Returns
Indication as to whether initialization has succeeded.

Implemented in GHOST_ContextWGL, GHOST_ContextSDL, GHOST_ContextNone, GHOST_ContextGLX, GHOST_ContextEGL, GHOST_ContextD3D, and GHOST_ContextCGL.

◆ isStereoVisual()

bool GHOST_Context::isStereoVisual ( ) const
inline

Stereo visual created. Only necessary for 'real' stereo support, ie quad buffered stereo. This is not always possible, depends on the graphics h/w

Definition at line 116 of file GHOST_Context.h.

References m_stereoVisual.

◆ isUpsideDown()

virtual bool GHOST_Context::isUpsideDown ( ) const
inlinevirtual

Returns if the context is rendered upside down compared to OpenGL.

Reimplemented in GHOST_ContextD3D.

Definition at line 124 of file GHOST_Context.h.

Referenced by GHOST_XrGraphicsBindingOpenGL::needsUpsideDownDrawing().

◆ releaseDrawingContext()

virtual GHOST_TSuccess GHOST_Context::releaseDrawingContext ( )
pure virtual

Release the drawing context of the calling thread.

Returns
A boolean success indicator.

Implements GHOST_IContext.

Implemented in GHOST_ContextWGL, GHOST_ContextSDL, GHOST_ContextNone, GHOST_ContextGLX, GHOST_ContextEGL, GHOST_ContextD3D, and GHOST_ContextCGL.

◆ releaseNativeHandles()

virtual GHOST_TSuccess GHOST_Context::releaseNativeHandles ( )
pure virtual

Checks if it is OK for a remove the native display

Returns
Indication as to whether removal has succeeded.

Implemented in GHOST_ContextWGL, GHOST_ContextSDL, GHOST_ContextNone, GHOST_ContextGLX, GHOST_ContextEGL, GHOST_ContextD3D, and GHOST_ContextCGL.

Referenced by GHOST_Window::releaseNativeHandles().

◆ setSwapInterval()

virtual GHOST_TSuccess GHOST_Context::setSwapInterval ( int  )
inlinevirtual

Sets the swap interval for swapBuffers.

Parameters
intervalThe swap interval to use.
Returns
A boolean success indicator.

Reimplemented in GHOST_ContextD3D, GHOST_ContextWGL, GHOST_ContextSDL, GHOST_ContextNone, GHOST_ContextGLX, GHOST_ContextEGL, and GHOST_ContextCGL.

Definition at line 80 of file GHOST_Context.h.

References GHOST_kFailure.

Referenced by GHOST_Window::setSwapInterval().

◆ setUserData()

void GHOST_Context::setUserData ( void user_data)
inline

Set user data (intended for the caller to use as needed).

Definition at line 106 of file GHOST_Context.h.

References m_user_data, and user_data.

◆ swapBuffers()

virtual GHOST_TSuccess GHOST_Context::swapBuffers ( )
pure virtual

Swaps front and back buffers of a window.

Returns
A boolean success indicator.

Implements GHOST_IContext.

Implemented in GHOST_ContextWGL, GHOST_ContextSDL, GHOST_ContextNone, GHOST_ContextGLX, GHOST_ContextEGL, GHOST_ContextD3D, and GHOST_ContextCGL.

Referenced by GHOST_Window::swapBuffers().

◆ updateDrawingContext()

virtual GHOST_TSuccess GHOST_Context::updateDrawingContext ( )
inlinevirtual

Updates the drawing context of this window. Needed whenever the window is changed.

Returns
Indication of success.

Reimplemented in GHOST_ContextNone, GHOST_ContextD3D, and GHOST_ContextCGL.

Definition at line 64 of file GHOST_Context.h.

References GHOST_kFailure.

Referenced by GHOST_Window::updateDrawingContext().

Member Data Documentation

◆ m_stereoVisual

bool GHOST_Context::m_stereoVisual
protected

◆ m_user_data

void* GHOST_Context::m_user_data = nullptr
protected

Caller specified, not for internal use.

Definition at line 144 of file GHOST_Context.h.

Referenced by getUserData(), and setUserData().


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