Blender  V2.93
List of all members
GHOST_XrContext Class Reference

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

#include <GHOST_XrContext.h>

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.

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
 
- 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 64 of file GHOST_XrContext.h.

Constructor & Destructor Documentation

◆ GHOST_XrContext()

GHOST_XrContext::GHOST_XrContext ( const GHOST_XrContextCreateInfo *  create_info)

Definition at line 61 of file GHOST_XrContext.cpp.

◆ ~GHOST_XrContext()

GHOST_XrContext::~GHOST_XrContext ( )

Definition at line 68 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 248 of file GHOST_XrContext.cpp.

References error(), and isDebugMode().

◆ drawSessionViews()

void GHOST_XrContext::drawSessionViews ( void *  draw_customdata)
overridevirtual

Implements GHOST_IXrContext.

Definition at line 517 of file GHOST_XrContext.cpp.

◆ endSession()

void GHOST_XrContext::endSession ( )
overridevirtual

Implements GHOST_IXrContext.

Definition at line 500 of file GHOST_XrContext.cpp.

◆ getCustomFuncs()

const GHOST_XrCustomFuncs & GHOST_XrContext::getCustomFuncs ( ) const

◆ getGraphicsBindingType()

GHOST_TXrGraphicsBinding GHOST_XrContext::getGraphicsBindingType ( ) const

Definition at line 580 of file GHOST_XrContext.cpp.

Referenced by GHOST_XrSession::start().

◆ getInstance()

XrInstance GHOST_XrContext::getInstance ( ) const

Definition at line 585 of file GHOST_XrContext.cpp.

Referenced by GHOST_XrEventsHandle(), and GHOST_XrSession::start().

◆ getOpenXRRuntimeID()

GHOST_TXrOpenXRRuntimeID GHOST_XrContext::getOpenXRRuntimeID ( ) const

Definition at line 570 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 525 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 84 of file GHOST_XrContext.cpp.

References isDebugMode().

◆ isDebugMode()

bool GHOST_XrContext::isDebugMode ( ) const

Definition at line 590 of file GHOST_XrContext.cpp.

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

◆ isDebugTimeMode()

bool GHOST_XrContext::isDebugTimeMode ( ) const

Definition at line 595 of file GHOST_XrContext.cpp.

◆ isSessionRunning()

bool GHOST_XrContext::isSessionRunning ( ) const
overridevirtual

Implements GHOST_IXrContext.

Definition at line 512 of file GHOST_XrContext.cpp.

◆ needsUpsideDownDrawing()

bool GHOST_XrContext::needsUpsideDownDrawing ( ) const
overridevirtual

Implements GHOST_IXrContext.

Definition at line 556 of file GHOST_XrContext.cpp.

◆ setDrawViewFunc()

void GHOST_XrContext::setDrawViewFunc ( GHOST_XrDrawViewFn  draw_view_fn)
overridevirtual

Implements GHOST_IXrContext.

Definition at line 551 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 266 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: