Blender  V3.3
Public Member Functions | List of all members
GHOST_ContextCGL Class Reference

#include <GHOST_ContextCGL.h>

Inheritance diagram for GHOST_ContextCGL:
GHOST_Context GHOST_IContext

Public Member Functions

 GHOST_ContextCGL (bool stereoVisual, NSView *metalView, CAMetalLayer *metalLayer, NSOpenGLView *openglView)
 
 ~GHOST_ContextCGL ()
 
GHOST_TSuccess swapBuffers ()
 
GHOST_TSuccess activateDrawingContext ()
 
GHOST_TSuccess releaseDrawingContext ()
 
unsigned int getDefaultFramebuffer ()
 
GHOST_TSuccess initializeDrawingContext ()
 
GHOST_TSuccess releaseNativeHandles ()
 
GHOST_TSuccess setSwapInterval (int interval)
 
GHOST_TSuccess getSwapInterval (int &)
 
GHOST_TSuccess updateDrawingContext ()
 
- Public Member Functions inherited from GHOST_Context
 GHOST_Context (bool stereoVisual)
 
virtual ~GHOST_Context ()
 
voidgetUserData ()
 
void setUserData (void *user_data)
 
bool isStereoVisual () const
 
virtual bool isUpsideDown () const
 
- Public Member Functions inherited from GHOST_IContext
virtual ~GHOST_IContext ()
 

Additional Inherited Members

- Protected Member Functions inherited from GHOST_Context
void initContextGLEW ()
 
- Static Protected Member Functions inherited from GHOST_Context
static void initClearGL ()
 
- Protected Attributes inherited from GHOST_Context
bool m_stereoVisual
 
voidm_user_data = nullptr
 

Detailed Description

Definition at line 20 of file GHOST_ContextCGL.h.

Constructor & Destructor Documentation

◆ GHOST_ContextCGL()

GHOST_ContextCGL::GHOST_ContextCGL ( bool  stereoVisual,
NSView *  metalView,
CAMetalLayer *  metalLayer,
NSOpenGLView *  openglView 
)

Constructor.

Definition at line 46 of file GHOST_ContextCGL.mm.

◆ ~GHOST_ContextCGL()

GHOST_ContextCGL::~GHOST_ContextCGL ( )

Destructor.

Definition at line 72 of file GHOST_ContextCGL.mm.

Member Function Documentation

◆ activateDrawingContext()

GHOST_TSuccess GHOST_ContextCGL::activateDrawingContext ( )
virtual

Activates the drawing context of this window.

Returns
A boolean success indicator.

Implements GHOST_Context.

Definition at line 149 of file GHOST_ContextCGL.mm.

References GHOST_kFailure, GHOST_kSuccess, init, and blender::compositor::pool.

◆ getDefaultFramebuffer()

unsigned int GHOST_ContextCGL::getDefaultFramebuffer ( )
virtual

Gets the OpenGL frame-buffer associated with the OpenGL context

Returns
The ID of an OpenGL frame-buffer object.

Reimplemented from GHOST_Context.

Definition at line 175 of file GHOST_ContextCGL.mm.

◆ getSwapInterval()

GHOST_TSuccess GHOST_ContextCGL::getSwapInterval ( int &  intervalOut)
virtual

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 from GHOST_Context.

Definition at line 129 of file GHOST_ContextCGL.mm.

References GHOST_kFailure, GHOST_kSuccess, init, and blender::compositor::pool.

◆ initializeDrawingContext()

GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext ( )
virtual

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

Returns
Indication as to whether initialization has succeeded.

Implements GHOST_Context.

Definition at line 240 of file GHOST_ContextCGL.mm.

References GHOST_kFailure, GHOST_kSuccess, GHOST_Context::initClearGL(), GHOST_Context::initContextGLEW(), GHOST_Context::m_stereoVisual, and makeAttribList().

◆ releaseDrawingContext()

GHOST_TSuccess GHOST_ContextCGL::releaseDrawingContext ( )
virtual

Release the drawing context of the calling thread.

Returns
A boolean success indicator.

Implements GHOST_Context.

Definition at line 162 of file GHOST_ContextCGL.mm.

References GHOST_kFailure, GHOST_kSuccess, init, and blender::compositor::pool.

◆ releaseNativeHandles()

GHOST_TSuccess GHOST_ContextCGL::releaseNativeHandles ( )
virtual

Removes references to native handles from this context and then returns

Returns
GHOST_kSuccess if it is OK for the parent to release the handles and GHOST_kFailure if releasing the handles will interfere with sharing

Implements GHOST_Context.

Definition at line 364 of file GHOST_ContextCGL.mm.

References GHOST_kSuccess.

◆ setSwapInterval()

GHOST_TSuccess GHOST_ContextCGL::setSwapInterval ( int  interval)
virtual

Sets the swap interval for swapBuffers.

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

Reimplemented from GHOST_Context.

Definition at line 116 of file GHOST_ContextCGL.mm.

References GHOST_kFailure, GHOST_kSuccess, init, and blender::compositor::pool.

◆ swapBuffers()

GHOST_TSuccess GHOST_ContextCGL::swapBuffers ( )
virtual

Swaps front and back buffers of a window.

Returns
A boolean success indicator.

Implements GHOST_Context.

Definition at line 98 of file GHOST_ContextCGL.mm.

References GHOST_kFailure, GHOST_kSuccess, init, and blender::compositor::pool.

◆ updateDrawingContext()

GHOST_TSuccess GHOST_ContextCGL::updateDrawingContext ( )
virtual

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

Returns
Indication of success.

Reimplemented from GHOST_Context.

Definition at line 180 of file GHOST_ContextCGL.mm.

References GHOST_kFailure, GHOST_kSuccess, init, blender::compositor::pool, and update().


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