Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/sharedglcontext.cpp

Go to the documentation of this file.
00001 #include <QGLContext>
00002 #include <QGLFormat>
00003 #include "sharedglcontext.h"
00004 
00007 QGLContext* SharedGLContext::s_pSharedGLContext = (QGLContext*)NULL;
00008 
00009 QGLContext* SharedGLContext::getContext()
00010 {
00011     QGLContext *ctxt;
00012     
00013     if (s_pSharedGLContext == (QGLContext*)NULL) {
00014         s_pSharedGLContext = new QGLContext(QGLFormat(QGL::SampleBuffers));
00015         s_pSharedGLContext->create();
00016         s_pSharedGLContext->makeCurrent();
00017     }
00018     
00019     ctxt = new QGLContext(QGLFormat(QGL::SampleBuffers));
00020     ctxt->create(s_pSharedGLContext);
00021 
00022     return ctxt;
00023 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines