Blender V4.5
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)
 ~GHOST_Context () override
GHOST_TSuccess swapBuffers () override=0
GHOST_TSuccess activateDrawingContext () override=0
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
unsigned int getDefaultFramebuffer () override
Public Member Functions inherited from GHOST_IContext
virtual ~GHOST_IContext ()=default

Static Public Member Functions

static GHOST_ContextgetActiveDrawingContext ()
Static Public Member Functions inherited from GHOST_IContext
static GHOST_IContextgetActiveDrawingContext ()

Protected Attributes

bool m_stereoVisual
void * m_user_data = nullptr

Static Protected Attributes

static GHOST_Contextactive_context_

Detailed Description

Definition at line 17 of file GHOST_Context.hh.

Constructor & Destructor Documentation

◆ GHOST_Context()

◆ ~GHOST_Context()

GHOST_Context::~GHOST_Context ( )
inlineoverride

Destructor.

Definition at line 31 of file GHOST_Context.hh.

References active_context_.

Member Function Documentation

◆ activateDrawingContext()

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.

◆ getActiveDrawingContext()

GHOST_Context * GHOST_Context::getActiveDrawingContext ( )
inlinestatic

Returns the thread's currently active drawing context.

Definition at line 41 of file GHOST_Context.hh.

References active_context_, and GHOST_Context().

Referenced by GHOST_IContext::getActiveDrawingContext().

◆ getDefaultFramebuffer()

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

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

References GHOST_kFailure.

◆ getUserData()

void * GHOST_Context::getUserData ( )
inline

Get user data.

Definition at line 109 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 127 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, and GHOST_ContextVK.

Definition at line 135 of file GHOST_Context.hh.

Referenced by GHOST_XrGraphicsBindingOpenGL::needsUpsideDownDrawing(), and GHOST_XrGraphicsBindingVulkan::needsUpsideDownDrawing().

◆ releaseDrawingContext()

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.

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

References GHOST_kFailure.

◆ setUserData()

void GHOST_Context::setUserData ( void * user_data)
inline

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

Definition at line 117 of file GHOST_Context.hh.

References m_user_data.

◆ swapBuffers()

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.

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

References GHOST_kFailure.

Member Data Documentation

◆ active_context_

◆ m_stereoVisual

◆ m_user_data

void* GHOST_Context::m_user_data = nullptr
protected

Caller specified, not for internal use.

Definition at line 206 of file GHOST_Context.hh.

Referenced by getUserData(), and setUserData().


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