Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

nvgl.h

00001 // Copyright NVIDIA Corporation 2002-2004
00002 // TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
00003 // *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
00004 // OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
00005 // AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
00006 // BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
00007 // WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
00008 // BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
00009 // ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
00010 // BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES 
00011 
00012 #pragma once
00013 
00014 #include "nvsgcommon.h"
00015 
00016 #include <GL/gl.h>  // standard OpenGL header satisfying OpenGL 1.1 API
00017 #include <GL/glu.h> // OpenGL utility
00018 
00019 // Calling convention define required below.
00020 // Note: GLAPI is already defined in gl.h from Mesa 3-D graphics library (Linux build),
00021 // where it is used to specify the linkage and not the calling convention.
00022 #ifdef _WIN32
00023 # define GLAPI __stdcall
00024 #else
00025 # define GLAPI 
00026 #endif
00027 
00028 // Note: Be sure to define GL_GLEXT_LEGACY when building on Linux with Mesa 3-D headers!
00029 #include "GL/glext.h"   // OpenGL extension
00030 #if defined(_WIN32)
00031 # include "GL/wglext.h" // Microsoft specific OpenGL extensions
00032 #elif defined(LINUX)
00033 # include "GL/glx.h"
00034 # include "nvgl/glxtypes.h"
00035 #endif               
00036  
00037 // STL header
00038 #include <map>
00039 
00040 // GL error tracing macro
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 }

Generated on Tue Mar 1 13:19:20 2005 for NVSGSDK by NVIDIA