Blender V5.0
GHOST_XrContext Class Reference

Main GHOST container to manage OpenXR through. More...

#include <GHOST_XrContext.hh>

Inherits GHOST_IXrContext.

Public Member Functions

Session management

Manage session lifetime and delegate public calls to GHOST_XrSession.

void startSession (const GHOST_XrSessionBeginInfo *begin_info) override
void endSession () override
bool isSessionRunning () const override
void drawSessionViews (void *draw_customdata) override
void handleSessionStateChange (const XrEventDataSessionStateChanged &lifecycle)
Public Accessors and Mutators

Public as in, exposed in the Ghost API.

GHOST_XrSessiongetSession () override
const GHOST_XrSessiongetSession () const override
void setGraphicsContextBindFuncs (GHOST_XrGraphicsContextBindFn bind_fn, GHOST_XrGraphicsContextUnbindFn unbind_fn) override
void setDrawViewFunc (GHOST_XrDrawViewFn draw_view_fn) override
void setPassthroughEnabledFunc (GHOST_XrPassthroughEnabledFn passthrough_enabled_fn) override
void setDisablePassthroughFunc (GHOST_XrDisablePassthroughFn disable_passthrough_fn) override
bool needsUpsideDownDrawing () const override
Ghost Internal Accessors and Mutators
GHOST_TXrOpenXRRuntimeID getOpenXRRuntimeID () const
const GHOST_XrCustomFuncsgetCustomFuncs () const
GHOST_TXrGraphicsBinding getGraphicsBindingType () const
XrInstance getInstance () const
bool isDebugMode () const
bool isDebugTimeMode () const
bool isExtensionEnabled (const char *ext) const
Public Member Functions inherited from GHOST_IXrContext
virtual ~GHOST_IXrContext ()=default

Create, Initialize and Destruct

 GHOST_XrContext (const GHOST_XrContextCreateInfo *create_info)
 ~GHOST_XrContext ()
void initialize (const GHOST_XrContextCreateInfo *create_info)

Error handling

void dispatchErrorMessage (const class GHOST_XrException *exception) const override
static void setErrorHandler (GHOST_XrErrorHandlerFn handler_fn, void *customdata)

Detailed Description

Main GHOST container to manage OpenXR through.

Creating a context using GHOST_XrContextCreate involves dynamically connecting to the OpenXR runtime, likely reading the OS OpenXR configuration (i.e. active_runtime.json). So this is something that should better be done using lazy-initialization.

Definition at line 60 of file GHOST_XrContext.hh.

Constructor & Destructor Documentation

◆ GHOST_XrContext()

GHOST_XrContext::GHOST_XrContext ( const GHOST_XrContextCreateInfo * create_info)

Definition at line 49 of file GHOST_XrContext.cc.

◆ ~GHOST_XrContext()

GHOST_XrContext::~GHOST_XrContext ( )

Definition at line 56 of file GHOST_XrContext.cc.

References assert, and CHECK_XR_ASSERT.

Member Function Documentation

◆ dispatchErrorMessage()

void GHOST_XrContext::dispatchErrorMessage ( const class GHOST_XrException * exception) const
overridevirtual

Implements GHOST_IXrContext.

Definition at line 248 of file GHOST_XrContext.cc.

References error(), getInstance(), and isDebugMode().

◆ drawSessionViews()

void GHOST_XrContext::drawSessionViews ( void * draw_customdata)
overridevirtual

Implements GHOST_IXrContext.

Definition at line 570 of file GHOST_XrContext.cc.

◆ endSession()

void GHOST_XrContext::endSession ( )
overridevirtual

Implements GHOST_IXrContext.

Definition at line 553 of file GHOST_XrContext.cc.

◆ getCustomFuncs()

const GHOST_XrCustomFuncs & GHOST_XrContext::getCustomFuncs ( ) const

Definition at line 649 of file GHOST_XrContext.cc.

◆ getGraphicsBindingType()

GHOST_TXrGraphicsBinding GHOST_XrContext::getGraphicsBindingType ( ) const

Definition at line 654 of file GHOST_XrContext.cc.

◆ getInstance()

XrInstance GHOST_XrContext::getInstance ( ) const

Definition at line 659 of file GHOST_XrContext.cc.

Referenced by dispatchErrorMessage(), and GHOST_XrEventsHandle().

◆ getOpenXRRuntimeID()

GHOST_TXrOpenXRRuntimeID GHOST_XrContext::getOpenXRRuntimeID ( ) const

Definition at line 644 of file GHOST_XrContext.cc.

◆ getSession() [1/2]

const GHOST_XrSession * GHOST_XrContext::getSession ( ) const
overridevirtual

Implements GHOST_IXrContext.

Definition at line 599 of file GHOST_XrContext.cc.

◆ getSession() [2/2]

GHOST_XrSession * GHOST_XrContext::getSession ( )
overridevirtual

Needed for the GHOST C api.

Implements GHOST_IXrContext.

Definition at line 594 of file GHOST_XrContext.cc.

◆ handleSessionStateChange()

void GHOST_XrContext::handleSessionStateChange ( const XrEventDataSessionStateChanged & lifecycle)

Delegates event to session, allowing context to destruct the session if needed.

Definition at line 578 of file GHOST_XrContext.cc.

References GHOST_XrSession::SESSION_DESTROY.

Referenced by GHOST_XrEventsHandle().

◆ initialize()

void GHOST_XrContext::initialize ( const GHOST_XrContextCreateInfo * create_info)

Definition at line 72 of file GHOST_XrContext.cc.

References assert, and isDebugMode().

◆ isDebugMode()

bool GHOST_XrContext::isDebugMode ( ) const

Definition at line 664 of file GHOST_XrContext.cc.

Referenced by dispatchErrorMessage(), GHOST_XrEventsHandle(), and initialize().

◆ isDebugTimeMode()

bool GHOST_XrContext::isDebugTimeMode ( ) const

Definition at line 669 of file GHOST_XrContext.cc.

◆ isExtensionEnabled()

bool GHOST_XrContext::isExtensionEnabled ( const char * ext) const

Definition at line 674 of file GHOST_XrContext.cc.

◆ isSessionRunning()

bool GHOST_XrContext::isSessionRunning ( ) const
overridevirtual

Implements GHOST_IXrContext.

Definition at line 565 of file GHOST_XrContext.cc.

◆ needsUpsideDownDrawing()

bool GHOST_XrContext::needsUpsideDownDrawing ( ) const
overridevirtual

Implements GHOST_IXrContext.

Definition at line 631 of file GHOST_XrContext.cc.

References assert.

◆ setDisablePassthroughFunc()

void GHOST_XrContext::setDisablePassthroughFunc ( GHOST_XrDisablePassthroughFn disable_passthrough_fn)
overridevirtual

Implements GHOST_IXrContext.

Definition at line 625 of file GHOST_XrContext.cc.

◆ setDrawViewFunc()

void GHOST_XrContext::setDrawViewFunc ( GHOST_XrDrawViewFn draw_view_fn)
overridevirtual

Implements GHOST_IXrContext.

Definition at line 614 of file GHOST_XrContext.cc.

◆ setErrorHandler()

void GHOST_XrContext::setErrorHandler ( GHOST_XrErrorHandlerFn handler_fn,
void * customdata )
static

Definition at line 270 of file GHOST_XrContext.cc.

Referenced by GHOST_XrErrorHandler().

◆ setGraphicsContextBindFuncs()

void GHOST_XrContext::setGraphicsContextBindFuncs ( GHOST_XrGraphicsContextBindFn bind_fn,
GHOST_XrGraphicsContextUnbindFn unbind_fn )
overridevirtual

Implements GHOST_IXrContext.

Definition at line 604 of file GHOST_XrContext.cc.

◆ setPassthroughEnabledFunc()

void GHOST_XrContext::setPassthroughEnabledFunc ( GHOST_XrPassthroughEnabledFn passthrough_enabled_fn)
overridevirtual

Implements GHOST_IXrContext.

Definition at line 619 of file GHOST_XrContext.cc.

◆ startSession()

void GHOST_XrContext::startSession ( const GHOST_XrSessionBeginInfo * begin_info)
overridevirtual

Implements GHOST_IXrContext.

Definition at line 541 of file GHOST_XrContext.cc.


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