You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
#include "guiOpenGLProvider.h"
guiOpenGLProvider* guiOpenGLProvider::_instance = 0;
/**
* Returns the single instance of the object. */guiOpenGLProvider* guiOpenGLProvider::getInstance() { // check if the instance has been created yet
if (0 == _instance) { // if not, then create it
_instance = new guiOpenGLProvider; } // return the single instance
return _instance;};
QOpenGLContext *guiOpenGLProvider::grabContext( void ){ m_pContextProtectorMutex->lock(); return m_pContext;};
QOpenGLContext *guiOpenGLProvider::tryGrabContext( void ){ if( m_pContextProtectorMutex->try_lock() ) return m_pContext; return NULL;};
void guiOpenGLProvider::releaseContext( void ){ m_pContextProtectorMutex->unlock();};
|