Blender V4.5
GHOST_ContextD3D Class Reference

#include <GHOST_ContextD3D.hh>

Inherits GHOST_Context.

Public Member Functions

 GHOST_ContextD3D (bool stereoVisual, HWND hWnd)
 ~GHOST_ContextD3D () override
GHOST_TSuccess swapBuffers () override
GHOST_TSuccess activateDrawingContext () override
GHOST_TSuccess releaseDrawingContext () override
GHOST_TSuccess initializeDrawingContext () override
GHOST_TSuccess updateDrawingContext () override
GHOST_TSuccess releaseNativeHandles () override
GHOST_TSuccess setSwapInterval (int) override
GHOST_TSuccess getSwapInterval (int &) override
unsigned int getDefaultFramebuffer () override
class GHOST_SharedOpenGLResourcecreateSharedOpenGLResource (unsigned int width, unsigned int height, DXGI_FORMAT format, ID3D11RenderTargetView *render_target)
class GHOST_SharedOpenGLResourcecreateSharedOpenGLResource (unsigned int width, unsigned int height, DXGI_FORMAT format)
void disposeSharedOpenGLResource (class GHOST_SharedOpenGLResource *shared_res)
GHOST_TSuccess blitFromOpenGLContext (class GHOST_SharedOpenGLResource *shared_res, unsigned int width, unsigned int height)
ID3D11Texture2D * getSharedTexture2D (class GHOST_SharedOpenGLResource *shared_res)
bool isUpsideDown () const override
Public Member Functions inherited from GHOST_Context
 GHOST_Context (bool stereoVisual)
 ~GHOST_Context () override
void * getUserData ()
void setUserData (void *user_data)
bool isStereoVisual () const
Public Member Functions inherited from GHOST_IContext
virtual ~GHOST_IContext ()=default

Friends

class GHOST_XrGraphicsBindingD3D
class GHOST_XrGraphicsBindingOpenGLD3D
class GHOST_XrGraphicsBindingVulkanD3D

Additional Inherited Members

Static Public Member Functions inherited from GHOST_Context
static GHOST_ContextgetActiveDrawingContext ()
Static Public Member Functions inherited from GHOST_IContext
static GHOST_IContextgetActiveDrawingContext ()
Protected Attributes inherited from GHOST_Context
bool m_stereoVisual
void * m_user_data = nullptr
Static Protected Attributes inherited from GHOST_Context
static GHOST_Contextactive_context_

Detailed Description

Definition at line 19 of file GHOST_ContextD3D.hh.

Constructor & Destructor Documentation

◆ GHOST_ContextD3D()

GHOST_ContextD3D::GHOST_ContextD3D ( bool stereoVisual,
HWND hWnd )

Definition at line 23 of file GHOST_ContextD3D.cc.

References GHOST_Context::GHOST_Context().

◆ ~GHOST_ContextD3D()

GHOST_ContextD3D::~GHOST_ContextD3D ( )
override

Definition at line 28 of file GHOST_ContextD3D.cc.

Member Function Documentation

◆ activateDrawingContext()

GHOST_TSuccess GHOST_ContextD3D::activateDrawingContext ( )
overridevirtual

Activates the drawing context of this window.

Returns
A boolean success indicator.

Implements GHOST_Context.

Definition at line 40 of file GHOST_ContextD3D.cc.

References GHOST_Context::active_context_, and GHOST_kFailure.

◆ blitFromOpenGLContext()

GHOST_TSuccess GHOST_ContextD3D::blitFromOpenGLContext ( class GHOST_SharedOpenGLResource * shared_res,
unsigned int width,
unsigned int height )

Definition at line 396 of file GHOST_ContextD3D.cc.

References GHOST_SharedOpenGLResource::blit().

◆ createSharedOpenGLResource() [1/2]

GHOST_SharedOpenGLResource * GHOST_ContextD3D::createSharedOpenGLResource ( unsigned int width,
unsigned int height,
DXGI_FORMAT format )

Definition at line 384 of file GHOST_ContextD3D.cc.

References createSharedOpenGLResource().

◆ createSharedOpenGLResource() [2/2]

GHOST_SharedOpenGLResource * GHOST_ContextD3D::createSharedOpenGLResource ( unsigned int width,
unsigned int height,
DXGI_FORMAT format,
ID3D11RenderTargetView * render_target )

Definition at line 367 of file GHOST_ContextD3D.cc.

Referenced by createSharedOpenGLResource().

◆ disposeSharedOpenGLResource()

void GHOST_ContextD3D::disposeSharedOpenGLResource ( class GHOST_SharedOpenGLResource * shared_res)

Definition at line 391 of file GHOST_ContextD3D.cc.

◆ getDefaultFramebuffer()

unsigned int GHOST_ContextD3D::getDefaultFramebuffer ( )
inlineoverridevirtual

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 93 of file GHOST_ContextD3D.hh.

◆ getSharedTexture2D()

ID3D11Texture2D * GHOST_ContextD3D::getSharedTexture2D ( class GHOST_SharedOpenGLResource * shared_res)

◆ getSwapInterval()

GHOST_TSuccess GHOST_ContextD3D::getSwapInterval ( int & )
inlineoverridevirtual

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 84 of file GHOST_ContextD3D.hh.

References GHOST_kFailure.

◆ initializeDrawingContext()

GHOST_TSuccess GHOST_ContextD3D::initializeDrawingContext ( )
overridevirtual

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 80 of file GHOST_ContextD3D.cc.

References GHOST_Context::active_context_, GHOST_kFailure, and GHOST_kSuccess.

◆ isUpsideDown()

bool GHOST_ContextD3D::isUpsideDown ( ) const
inlineoverridevirtual

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

Reimplemented from GHOST_Context.

Definition at line 112 of file GHOST_ContextD3D.hh.

◆ releaseDrawingContext()

GHOST_TSuccess GHOST_ContextD3D::releaseDrawingContext ( )
overridevirtual

Release the drawing context of the calling thread.

Returns
A boolean success indicator.

Implements GHOST_Context.

Definition at line 46 of file GHOST_ContextD3D.cc.

References GHOST_Context::active_context_, and GHOST_kFailure.

◆ releaseNativeHandles()

GHOST_TSuccess GHOST_ContextD3D::releaseNativeHandles ( )
overridevirtual

Checks if it is OK for a remove the native display

Returns
Indication as to whether removal has succeeded.

Implements GHOST_Context.

Definition at line 108 of file GHOST_ContextD3D.cc.

References GHOST_kFailure.

◆ setSwapInterval()

GHOST_TSuccess GHOST_ContextD3D::setSwapInterval ( int )
inlineoverridevirtual

Sets the swap interval for swapBuffers.

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

Reimplemented from GHOST_Context.

Definition at line 74 of file GHOST_ContextD3D.hh.

References GHOST_kFailure.

◆ swapBuffers()

GHOST_TSuccess GHOST_ContextD3D::swapBuffers ( )
overridevirtual

Swaps front and back buffers of a window.

Returns
A boolean success indicator.

Implements GHOST_Context.

Definition at line 35 of file GHOST_ContextD3D.cc.

References GHOST_kSuccess.

◆ updateDrawingContext()

GHOST_TSuccess GHOST_ContextD3D::updateDrawingContext ( )
inlineoverridevirtual

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

Returns
Indication of success.

Reimplemented from GHOST_Context.

Definition at line 58 of file GHOST_ContextD3D.hh.

References GHOST_kFailure.

◆ GHOST_XrGraphicsBindingD3D

Definition at line 21 of file GHOST_ContextD3D.hh.

References GHOST_XrGraphicsBindingD3D.

Referenced by GHOST_XrGraphicsBindingD3D.

◆ GHOST_XrGraphicsBindingOpenGLD3D

◆ GHOST_XrGraphicsBindingVulkanD3D

friend class GHOST_XrGraphicsBindingVulkanD3D
friend

Definition at line 23 of file GHOST_ContextD3D.hh.

References GHOST_XrGraphicsBindingVulkanD3D.

Referenced by GHOST_XrGraphicsBindingVulkanD3D.


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