|
Blender V4.5
|
#include <GHOST_ContextCGL.hh>
Inherits GHOST_Context.
Public Member Functions | |
| GHOST_ContextCGL (bool stereoVisual, NSView *metalView, CAMetalLayer *metalLayer, int debug) | |
| ~GHOST_ContextCGL () override | |
| GHOST_TSuccess | swapBuffers () override |
| GHOST_TSuccess | activateDrawingContext () override |
| GHOST_TSuccess | releaseDrawingContext () override |
| unsigned int | getDefaultFramebuffer () override |
| GHOST_TSuccess | initializeDrawingContext () override |
| GHOST_TSuccess | releaseNativeHandles () override |
| GHOST_TSuccess | setSwapInterval (int interval) override |
| GHOST_TSuccess | getSwapInterval (int &intervalOut) override |
| GHOST_TSuccess | updateDrawingContext () override |
| id< MTLTexture > | metalOverlayTexture () |
| MTLCommandQueue * | metalCommandQueue () |
| MTLDevice * | metalDevice () |
| void | metalRegisterPresentCallback (void(*callback)(MTLRenderPassDescriptor *, id< MTLRenderPipelineState >, id< MTLTexture >, id< CAMetalDrawable >)) |
| Public Member Functions inherited from GHOST_Context | |
| GHOST_Context (bool stereoVisual) | |
| ~GHOST_Context () override | |
| void * | getUserData () |
| void | setUserData (void *user_data) |
| bool | isStereoVisual () const |
| virtual bool | isUpsideDown () const |
| Public Member Functions inherited from GHOST_IContext | |
| virtual | ~GHOST_IContext ()=default |
Static Public Attributes | |
| static const int | max_command_buffer_count = 64 |
Additional Inherited Members | |
| Static Public Member Functions inherited from GHOST_Context | |
| static GHOST_Context * | getActiveDrawingContext () |
| Static Public Member Functions inherited from GHOST_IContext | |
| static GHOST_IContext * | getActiveDrawingContext () |
| Protected Attributes inherited from GHOST_Context | |
| bool | m_stereoVisual |
| void * | m_user_data = nullptr |
| Static Protected Attributes inherited from GHOST_Context | |
| static GHOST_Context * | active_context_ |
Definition at line 26 of file GHOST_ContextCGL.hh.
| GHOST_ContextCGL::GHOST_ContextCGL | ( | bool | stereoVisual, |
| NSView * | metalView, | ||
| CAMetalLayer * | metalLayer, | ||
| int | debug ) |
Constructor.
Definition at line 49 of file GHOST_ContextCGL.mm.
References GHOST_Context::GHOST_Context(), ghost_fatal_error_dialog(), i, init(), METAL_FRAMEBUFFERPIXEL_FORMAT_EDR, metalDevice(), and printf.
Referenced by GHOST_SystemCocoa::createOffscreenContext(), and GHOST_WindowCocoa::newDrawingContext().
|
override |
|
overridevirtual |
Activates the drawing context of this window.
Implements GHOST_Context.
Definition at line 156 of file GHOST_ContextCGL.mm.
References GHOST_Context::active_context_, and GHOST_kSuccess.
|
overridevirtual |
Gets the OpenGL frame-buffer associated with the OpenGL context
Reimplemented from GHOST_Context.
Definition at line 168 of file GHOST_ContextCGL.mm.
|
overridevirtual |
Gets the current swap interval for swapBuffers.
| intervalOut | Variable to store the swap interval if it can be read. |
Reimplemented from GHOST_Context.
Definition at line 150 of file GHOST_ContextCGL.mm.
References GHOST_kSuccess.
|
overridevirtual |
Call immediately after new to initialize. If this fails then immediately delete the object.
Implements GHOST_Context.
Definition at line 211 of file GHOST_ContextCGL.mm.
References GHOST_Context::active_context_, and GHOST_kSuccess.
| MTLCommandQueue * GHOST_ContextCGL::metalCommandQueue | ( | ) |
Return a pointer to the Metal command queue used by this context.
Definition at line 195 of file GHOST_ContextCGL.mm.
| MTLDevice * GHOST_ContextCGL::metalDevice | ( | ) |
Return a pointer to the Metal device associated with this context.
Definition at line 199 of file GHOST_ContextCGL.mm.
Referenced by GHOST_ContextCGL().
| id< MTLTexture > GHOST_ContextCGL::metalOverlayTexture | ( | ) |
Returns a texture that Metal code can use as a render target. The current contents of this texture will be composited on top of the frame-buffer each time swapBuffers is called.
Definition at line 183 of file GHOST_ContextCGL.mm.
References updateDrawingContext().
| void GHOST_ContextCGL::metalRegisterPresentCallback | ( | void(* | callback )(MTLRenderPassDescriptor *, id< MTLRenderPipelineState >, id< MTLTexture >, id< CAMetalDrawable >) | ) |
Register present callback
Definition at line 205 of file GHOST_ContextCGL.mm.
|
overridevirtual |
Release the drawing context of the calling thread.
Implements GHOST_Context.
Definition at line 162 of file GHOST_ContextCGL.mm.
References GHOST_Context::active_context_, and GHOST_kSuccess.
|
overridevirtual |
Removes references to native handles from this context and then returns
Implements GHOST_Context.
Definition at line 222 of file GHOST_ContextCGL.mm.
References GHOST_kSuccess.
|
overridevirtual |
Sets the swap interval for swapBuffers.
| interval | The swap interval to use. |
Reimplemented from GHOST_Context.
Definition at line 144 of file GHOST_ContextCGL.mm.
References GHOST_kSuccess.
|
overridevirtual |
Swaps front and back buffers of a window.
Implements GHOST_Context.
Definition at line 136 of file GHOST_ContextCGL.mm.
References GHOST_kSuccess.
|
overridevirtual |
Updates the drawing context of this window. Needed whenever the window is changed.
Reimplemented from GHOST_Context.
Definition at line 174 of file GHOST_ContextCGL.mm.
References GHOST_kFailure, and GHOST_kSuccess.
Referenced by metalOverlayTexture().
|
static |
Definition at line 41 of file GHOST_ContextCGL.hh.
Referenced by blender::gpu::MTLCommandBufferManager::submit().