Blender  V3.3
List of all members
GHOST_XrContext Class Reference

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

#include <GHOST_XrContext.h>

Inheritance diagram for GHOST_XrContext:
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
 
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 52 of file GHOST_XrContext.h.

Constructor & Destructor Documentation

◆ GHOST_XrContext()

GHOST_XrContext::GHOST_XrContext ( const GHOST_XrContextCreateInfo *  create_info)

Definition at line 47 of file GHOST_XrContext.cpp.

◆ ~GHOST_XrContext()

GHOST_XrContext::~GHOST_XrContext ( )

Definition at line 54 of file GHOST_XrContext.cpp.

References CHECK_XR_ASSERT.

Member Function Documentation

◆ dispatchErrorMessage()

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

Implements GHOST_IXrContext.

Definition at line 244 of file GHOST_XrContext.cpp.

References error(), and isDebugMode().

◆ drawSessionViews()

void GHOST_XrContext::drawSessionViews ( void draw_customdata)
overridevirtual

Implements GHOST_IXrContext.

Definition at line 539 of file GHOST_XrContext.cpp.

◆ endSession()

void GHOST_XrContext::endSession ( )
overridevirtual

Implements GHOST_IXrContext.

Definition at line 522 of file GHOST_XrContext.cpp.

◆ getCustomFuncs()

const GHOST_XrCustomFuncs & GHOST_XrContext::getCustomFuncs ( ) const

◆ getGraphicsBindingType()

GHOST_TXrGraphicsBinding GHOST_XrContext::getGraphicsBindingType ( ) const

Definition at line 611 of file GHOST_XrContext.cpp.

Referenced by GHOST_XrSession::start().

◆ getInstance()

XrInstance GHOST_XrContext::getInstance ( ) const

◆ getOpenXRRuntimeID()

GHOST_TXrOpenXRRuntimeID GHOST_XrContext::getOpenXRRuntimeID ( ) const

Definition at line 601 of file GHOST_XrContext.cpp.

◆ getSession() [1/2]

const GHOST_XrSession * GHOST_XrContext::getSession ( ) const
overridevirtual

Implements GHOST_IXrContext.

Definition at line 568 of file GHOST_XrContext.cpp.

◆ getSession() [2/2]

GHOST_XrSession * GHOST_XrContext::getSession ( )
overridevirtual

Needed for the GHOST C api.

Implements GHOST_IXrContext.

Definition at line 563 of file GHOST_XrContext.cpp.

◆ handleSessionStateChange()

void GHOST_XrContext::handleSessionStateChange ( const XrEventDataSessionStateChanged &  lifecycle)

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

Definition at line 547 of file GHOST_XrContext.cpp.

References GHOST_XrSession::SESSION_DESTROY.

Referenced by GHOST_XrEventsHandle().

◆ initialize()

void GHOST_XrContext::initialize ( const GHOST_XrContextCreateInfo *  create_info)

Definition at line 70 of file GHOST_XrContext.cpp.

References isDebugMode().

◆ isDebugMode()

bool GHOST_XrContext::isDebugMode ( ) const

◆ isDebugTimeMode()

bool GHOST_XrContext::isDebugTimeMode ( ) const

Definition at line 626 of file GHOST_XrContext.cpp.

◆ isExtensionEnabled()

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

◆ isSessionRunning()

bool GHOST_XrContext::isSessionRunning ( ) const
overridevirtual

Implements GHOST_IXrContext.

Definition at line 534 of file GHOST_XrContext.cpp.

◆ needsUpsideDownDrawing()

bool GHOST_XrContext::needsUpsideDownDrawing ( ) const
overridevirtual

Implements GHOST_IXrContext.

Definition at line 588 of file GHOST_XrContext.cpp.

◆ setDrawViewFunc()

void GHOST_XrContext::setDrawViewFunc ( GHOST_XrDrawViewFn  draw_view_fn)
overridevirtual

Implements GHOST_IXrContext.

Definition at line 583 of file GHOST_XrContext.cpp.

References GHOST_XrCustomFuncs::draw_view_fn.

◆ setErrorHandler()

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

Definition at line 262 of file GHOST_XrContext.cpp.

Referenced by GHOST_XrErrorHandler().

◆ setGraphicsContextBindFuncs()

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

◆ startSession()

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

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