00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #pragma once
00013
00014 #include "nvsgcommon.h"
00015
00016 #include <GL/gl.h>
00017 #include <GL/glu.h>
00018
00019
00020
00021
00022 #ifdef _WIN32
00023 # define GLAPI __stdcall
00024 #else
00025 # define GLAPI
00026 #endif
00027
00028
00029 #include "GL/glext.h"
00030 #if defined(_WIN32)
00031 # include "GL/wglext.h"
00032 #elif defined(LINUX)
00033 # include "GL/glx.h"
00034 # include "nvgl/glxtypes.h"
00035 #endif
00036
00037
00038 #include <map>
00039
00040
00041 #ifdef _DEBUG
00042 # define ASSERT_GL_NO_ERROR __ASSERT( ( glError = glGetError() ) == GL_NO_ERROR )
00043 # define ASSERT_GL_NO_ERROR_IN_BEGIN_END __ASSERT( glContext->m_inBeginEndLoop || ( glError = glGetError() ) == GL_NO_ERROR )
00044 #else
00045 # define ASSERT_GL_NO_ERROR
00046 # define ASSERT_GL_NO_ERROR_IN_BEGIN_END
00047 #endif
00048
00050
00058 namespace nvgl
00059 {
00060 class GLContext;
00061
00062 extern NVSG_API GLContext * glContext;
00063 extern NVSG_API GLenum glError;
00064 #if defined(_WIN32)
00065 extern NVSG_API std::map<HGLRC, GLContext*> hglrcContextMap;
00066 #elif defined(LINUX)
00067 extern NVSG_API std::map<GLXContext, GLContext*> hglrcContextMap;
00068 #endif
00069 extern bool wglFunctionsInitialized;
00070 }