Nirtcpp 2.0.0
Nirtcpp is a high-performance c++ graphics engine.
nirt::video::IContextManager Class Referenceabstract
Inheritance diagram for nirt::video::IContextManager:
Inheritance graph
Collaboration diagram for nirt::video::IContextManager:
Collaboration graph

Public Member Functions

virtual bool initialize (const SNirtcppCreationParameters &params, const SExposedVideoData &data)=0
 Initialize manager with device creation parameters and device window (passed as exposed video data)
 
virtual void terminate ()=0
 Terminate manager, any cleanup that is left over. Manager needs a new initialize to be usable again.
 
virtual bool generateSurface ()=0
 Create surface based on current window set.
 
virtual void destroySurface ()=0
 Destroy current surface.
 
virtual bool generateContext ()=0
 Create context based on current surface.
 
virtual void destroyContext ()=0
 Destroy current context.
 
virtual const SExposedVideoDatagetContext () const =0
 Get current context.
 
virtual bool activateContext (const SExposedVideoData &videoData, bool restorePrimaryOnZero=false)=0
 Change render context, disable old and activate new defined by videoData. More...
 
virtual bool swapBuffers ()=0
 Swap buffers.
 
- Public Member Functions inherited from nirt::IReferenceCounted
 IReferenceCounted ()
 Constructor.
 
virtual ~IReferenceCounted ()
 Destructor.
 
void grab () const
 Grabs the object. Increments the reference counter by one. More...
 
bool drop () const
 Drops the object. Decrements the reference counter by one. More...
 
s32 getReferenceCount () const
 Get the reference count. More...
 
const c8getDebugName () const
 Returns the debug name of the object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from nirt::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object. More...
 

Member Function Documentation

◆ activateContext()

virtual bool nirt::video::IContextManager::activateContext ( const SExposedVideoData videoData,
bool  restorePrimaryOnZero = false 
)
pure virtual

Change render context, disable old and activate new defined by videoData.

This is mostly used internally by IVideoDriver::beginScene(). But if you want to switch threads which access your OpenGL driver you will have to call this function as follows: Old thread gives up context with: activateContext(nirt::video::SExposedVideoData()); New thread takes over context with: activateContext(videoDriver->getExposedVideoData()); Note that only 1 thread at a time may access an OpenGL context.


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