Blender V4.3
GHOST_Context Class Referenceabstract

#include <GHOST_Context.hh>

Inherits GHOST_IContext.

Inherited by GHOST_ContextCGL, GHOST_ContextD3D, GHOST_ContextEGL, GHOST_ContextGLX, GHOST_ContextNone, GHOST_ContextSDL, GHOST_ContextVK, and GHOST_ContextWGL.

Public Member Functions

 GHOST_Context (bool stereoVisual)
 
virtual ~GHOST_Context ()
 
virtual GHOST_TSuccess swapBuffers () override=0
 
virtual GHOST_TSuccess activateDrawingContext () override=0
 
virtual GHOST_TSuccess releaseDrawingContext () override=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 &)
 
void * getUserData ()
 
void setUserData (void *user_data)
 
bool isStereoVisual () const
 
virtual bool isUpsideDown () const
 
virtual unsigned int getDefaultFramebuffer () override
 
- Public Member Functions inherited from GHOST_IContext
virtual ~GHOST_IContext ()
 

Protected Attributes

bool m_stereoVisual
 
void * m_user_data = nullptr
 

Detailed Description

Definition at line 17 of file GHOST_Context.hh.

Constructor & Destructor Documentation

◆ GHOST_Context()

GHOST_Context::GHOST_Context ( bool stereoVisual)
inline

Constructor.

Parameters
stereoVisualStereo visual for quad buffered stereo.

Definition at line 23 of file GHOST_Context.hh.

◆ ~GHOST_Context()

virtual GHOST_Context::~GHOST_Context ( )
inlinevirtual

Destructor.

Definition at line 28 of file GHOST_Context.hh.

Member Function Documentation

◆ activateDrawingContext()

virtual GHOST_TSuccess GHOST_Context::activateDrawingContext ( )
overridepure virtual

Activates the drawing context of this window.

Returns
A boolean success indicator.

Implements GHOST_IContext.

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

Referenced by GHOST_Window::activateDrawingContext().

◆ getDefaultFramebuffer()

virtual unsigned int GHOST_Context::getDefaultFramebuffer ( )
inlineoverridevirtual

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_ContextCGL, and GHOST_ContextD3D.

Definition at line 128 of file GHOST_Context.hh.

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_ContextCGL, GHOST_ContextD3D, GHOST_ContextEGL, GHOST_ContextGLX, GHOST_ContextNone, GHOST_ContextSDL, GHOST_ContextVK, and GHOST_ContextWGL.

Definition at line 85 of file GHOST_Context.hh.

References GHOST_kFailure.

Referenced by GHOST_Window::getSwapInterval().

◆ getUserData()

void * GHOST_Context::getUserData ( )
inline

Get user data.

Definition at line 93 of file GHOST_Context.hh.

References m_user_data.

◆ 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_ContextCGL, GHOST_ContextD3D, GHOST_ContextEGL, GHOST_ContextGLX, GHOST_ContextNone, GHOST_ContextSDL, GHOST_ContextVK, and GHOST_ContextWGL.

◆ 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 111 of file GHOST_Context.hh.

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 119 of file GHOST_Context.hh.

Referenced by GHOST_XrGraphicsBindingOpenGL::needsUpsideDownDrawing().

◆ releaseDrawingContext()

virtual GHOST_TSuccess GHOST_Context::releaseDrawingContext ( )
overridepure virtual

Release the drawing context of the calling thread.

Returns
A boolean success indicator.

Implements GHOST_IContext.

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

◆ 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_ContextCGL, GHOST_ContextD3D, GHOST_ContextEGL, GHOST_ContextGLX, GHOST_ContextNone, GHOST_ContextSDL, GHOST_ContextVK, and GHOST_ContextWGL.

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_ContextCGL, GHOST_ContextD3D, GHOST_ContextEGL, GHOST_ContextGLX, GHOST_ContextNone, GHOST_ContextSDL, GHOST_ContextVK, and GHOST_ContextWGL.

Definition at line 75 of file GHOST_Context.hh.

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 101 of file GHOST_Context.hh.

References m_user_data.

◆ swapBuffers()

virtual GHOST_TSuccess GHOST_Context::swapBuffers ( )
overridepure virtual

Swaps front and back buffers of a window.

Returns
A boolean success indicator.

Implements GHOST_IContext.

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

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_ContextCGL, GHOST_ContextD3D, and GHOST_ContextNone.

Definition at line 59 of file GHOST_Context.hh.

References GHOST_kFailure.

Referenced by GHOST_Window::updateDrawingContext().

Member Data Documentation

◆ m_stereoVisual

◆ m_user_data

void* GHOST_Context::m_user_data = nullptr
protected

Caller specified, not for internal use.

Definition at line 192 of file GHOST_Context.hh.

Referenced by getUserData(), and setUserData().


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