NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkScopedOGLContext.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkScopedOGLContext_h
16 #define niftkScopedOGLContext_h
17 
18 #include <niftkCoreGuiExports.h>
19 #include <QtOpenGL/QGLContext>
20 
21 namespace niftk
22 {
23 
28 struct NIFTKCOREGUI_EXPORT ScopedOGLContext
29 {
30  ScopedOGLContext(QGLContext* newctx);
31  ~ScopedOGLContext();
32 
33  QGLContext* m_Prevctx;
34  QGLContext* m_Ourctx;
35 };
36 
37 } // end namespace
38 
39 #endif // niftkScopedOGLContext_h
QGLContext * m_Prevctx
Definition: niftkScopedOGLContext.h:33
QGLContext * m_Ourctx
Definition: niftkScopedOGLContext.h:34
Utility class to activate a given OpenGL context, and restore the previous one on scope-exit...
Definition: niftkScopedOGLContext.h:28
Definition: niftkExceptionObject.h:21