Raytrix Light Field SDK  5.0
Rx::LFR::COpenGlInterop Class Reference

Detailed Description

Provides methods for using OpenGL contexts and textures.

Inherits Rx::LFR::CPimpl< COpenGlInterop_Impl, Interfaces::EOpenGlInterop::ID >.

Public Member Functions

 COpenGlInterop ()
 Default constructor. More...
 
 COpenGlInterop (COpenGlInterop &&xOpenGlInterop)
 Move constructor. More...
 
 ~COpenGlInterop ()
 Destructor. More...
 
void CreateContextSharedWithCurrent ()
 Creates an OpenGL context that is shared with the current OpenGL context. This requires a current OpenGL context. More...
 
void DeleteStoredContext ()
 Deletes the stored context (if it has been created by CreateContextSharedWithCurrent). More...
 
void DestroyTexture (EImage::ID eImgID)
 Destroys the OpenGL texture of the image defined by the given ID. More...
 
void DestroyTextures ()
 Destroys all OpenGL textures. More...
 
COpenGlInterop_Impl & GetImpl ()
 Gets the non constant implementation. More...
 
const COpenGlInterop_Impl & GetImpl () const
 Gets the constant implementation. More...
 
void * GetInterface (Interfaces::EOpenGlInterop::ID eInterface)
 Gets the interface defined by the given interface ID. More...
 
TInterface * GetInterface (Interfaces::EOpenGlInterop::ID eInterface)
 Gets the interface defined by the given interface ID. More...
 
const void * GetInterface (Interfaces::EOpenGlInterop::ID eInterface) const
 Gets the interface defined by the given interface ID. More...
 
const TInterface * GetInterface (Interfaces::EOpenGlInterop::ID eInterface) const
 Gets the interface defined by the given interface ID. More...
 
unsigned GetTextureID (EImage::ID eImgID) const
 Gets the OpenGL texture ID of the image defined by the given ID. More...
 
bool HasInterface (Interfaces::EOpenGlInterop::ID eInterface)
 Queries if this object has the given interface. More...
 
bool HasStoredContext () const
 Query if this object has a valid OpenGL context stored. More...
 
bool MakeStoredContextCurrent () const
 Makes the stored OpenGL rendering context the calling thread's current rendering context. More...
 
COpenGlInteropoperator= (COpenGlInterop &&xOpenGlInterop)
 Move assignment operator. More...
 
void ReleaseContext () const
 Releases the current OpenGL context. Changes the calling thread's current rendering context so it's no longer current. This method does not delete the stored OpenGL context. More...
 
void StoreCurrentContext ()
 Stores the current OpenGL context. Throws an exception if the calling thread doesn't have a current OpenGL context. More...
 

Static Public Member Functions

static void GetVersion (int &iMajor, int &iMinor)
 Gets the OpenGL version. More...
 

Constructor & Destructor Documentation

◆ COpenGlInterop() [1/2]

Rx::LFR::COpenGlInterop::COpenGlInterop ( )

Default constructor.

◆ COpenGlInterop() [2/2]

Rx::LFR::COpenGlInterop::COpenGlInterop ( COpenGlInterop &&  xOpenGlInterop)

Move constructor.

Parameters
xOpenGlInterop[in,out] The open gl interop instance.

◆ ~COpenGlInterop()

Rx::LFR::COpenGlInterop::~COpenGlInterop ( )

Destructor.

Member Function Documentation

◆ CreateContextSharedWithCurrent()

void Rx::LFR::COpenGlInterop::CreateContextSharedWithCurrent ( )

Creates an OpenGL context that is shared with the current OpenGL context. This requires a current OpenGL context.

◆ DeleteStoredContext()

void Rx::LFR::COpenGlInterop::DeleteStoredContext ( )

Deletes the stored context (if it has been created by CreateContextSharedWithCurrent).

◆ DestroyTexture()

void Rx::LFR::COpenGlInterop::DestroyTexture ( EImage::ID  eImgID)

Destroys the OpenGL texture of the image defined by the given ID.

Attention: An OpenGL context must be stored before by calling StoreCurrentContext.

Parameters
eImgID[in] The image ID.

◆ DestroyTextures()

void Rx::LFR::COpenGlInterop::DestroyTextures ( )

Destroys all OpenGL textures.

Attention: An OpenGL context must be stored before by calling StoreCurrentContext.

◆ GetImpl() [1/2]

COpenGlInterop_Impl & Rx::LFR::CPimpl< COpenGlInterop_Impl , Interfaces::EOpenGlInterop::ID >::GetImpl
inlineinherited

Gets the non constant implementation.

Returns
The implementation.

◆ GetImpl() [2/2]

const COpenGlInterop_Impl & Rx::LFR::CPimpl< COpenGlInterop_Impl , Interfaces::EOpenGlInterop::ID >::GetImpl
inlineinherited

Gets the constant implementation.

Returns
The implementation.

◆ GetInterface() [1/4]

void* Rx::LFR::CPimpl< COpenGlInterop_Impl , Interfaces::EOpenGlInterop::ID >::GetInterface ( Interfaces::EOpenGlInterop::ID  eInterface)
inherited

Gets the interface defined by the given interface ID.

Parameters
eInterface[in] The interface ID.
Returns
Null if it fails, else the interface.

◆ GetInterface() [2/4]

TInterface* Rx::LFR::CPimpl< COpenGlInterop_Impl , Interfaces::EOpenGlInterop::ID >::GetInterface ( Interfaces::EOpenGlInterop::ID  eInterface)
inlineinherited

Gets the interface defined by the given interface ID.

Template Parameters
TInterface[in] The interface type.
Parameters
eInterface[in] The interface.
Returns
Null if it fails, else the interface.

◆ GetInterface() [3/4]

const void* Rx::LFR::CPimpl< COpenGlInterop_Impl , Interfaces::EOpenGlInterop::ID >::GetInterface ( Interfaces::EOpenGlInterop::ID  eInterface) const
inherited

Gets the interface defined by the given interface ID.

Parameters
eInterface[in] The interface ID.
Returns
Null if it fails, else the interface.

◆ GetInterface() [4/4]

const TInterface* Rx::LFR::CPimpl< COpenGlInterop_Impl , Interfaces::EOpenGlInterop::ID >::GetInterface ( Interfaces::EOpenGlInterop::ID  eInterface) const
inlineinherited

Gets the interface defined by the given interface ID.

Template Parameters
TInterface[in] The interface type.
Parameters
eInterface[in] The interface ID.
Returns
Null if it fails, else the interface.

◆ GetTextureID()

unsigned Rx::LFR::COpenGlInterop::GetTextureID ( EImage::ID  eImgID) const

Gets the OpenGL texture ID of the image defined by the given ID.

If the desired texture has not been created yet, the returned texture ID is 0.

Attention: An OpenGL context must be stored before by calling StoreCurrentContext.

Parameters
eImgID[in] The image ID.
Returns
The texture ID or 0.

◆ GetVersion()

static void Rx::LFR::COpenGlInterop::GetVersion ( int &  iMajor,
int &  iMinor 
)
static

Gets the OpenGL version.

Parameters
iMajor[out] The major part of the version.
iMinor[out] The minor part of the version.

◆ HasInterface()

bool Rx::LFR::CPimpl< COpenGlInterop_Impl , Interfaces::EOpenGlInterop::ID >::HasInterface ( Interfaces::EOpenGlInterop::ID  eInterface)
inlineinherited

Queries if this object has the given interface.

Parameters
eInterface[in] The interface to query.
Returns
True if this class has the given interface, false if not.

◆ HasStoredContext()

bool Rx::LFR::COpenGlInterop::HasStoredContext ( ) const

Query if this object has a valid OpenGL context stored.

Returns
True if OpenGL context stored, false if not.

◆ MakeStoredContextCurrent()

bool Rx::LFR::COpenGlInterop::MakeStoredContextCurrent ( ) const

Makes the stored OpenGL rendering context the calling thread's current rendering context.

Returns
Returns true if the calling thread didn't have the context BEFORE the call.

◆ operator=()

COpenGlInterop& Rx::LFR::COpenGlInterop::operator= ( COpenGlInterop &&  xOpenGlInterop)

Move assignment operator.

Parameters
xOpenGlInterop[in,out] The openGl instance.
Returns
The instance.

◆ ReleaseContext()

void Rx::LFR::COpenGlInterop::ReleaseContext ( ) const

Releases the current OpenGL context. Changes the calling thread's current rendering context so it's no longer current. This method does not delete the stored OpenGL context.

◆ StoreCurrentContext()

void Rx::LFR::COpenGlInterop::StoreCurrentContext ( )

Stores the current OpenGL context. Throws an exception if the calling thread doesn't have a current OpenGL context.