# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

driver_opengl_extension.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2000 Nevrax Ltd.
00008  *
00009  * This file is part of NEVRAX NEL.
00010  * NEVRAX NEL is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2, or (at your option)
00013  * any later version.
00014 
00015  * NEVRAX NEL is distributed in the hope that it will be useful, but
00016  * WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018  * General Public License for more details.
00019 
00020  * You should have received a copy of the GNU General Public License
00021  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00023  * MA 02111-1307, USA.
00024  */
00025 
00026 #ifndef NL_OPENGL_EXTENSION_H
00027 #define NL_OPENGL_EXTENSION_H
00028 
00029 
00030 #include "nel/misc/types_nl.h"
00031 
00032 #ifdef NL_OS_WINDOWS
00033 
00034 #define WIN32_LEAN_AND_MEAN
00035 #include <windows.h>
00036 
00037 #else // NL_OS_UNIX
00038 
00039 #define GL_GLEXT_PROTOTYPES
00040 #include <GL/glx.h>
00041 
00042 #endif // NL_OS_UNIX
00043 
00044 
00045 #include <GL/gl.h>
00046 #include <GL/glext.h>   // Please download it from http://oss.sgi.com/projects/ogl-sample/ABI/"
00047 
00048 #ifndef GL_GLEXT_VERSION
00049 #error "I need a newer <GL/glext.h>. Please download it from http://oss.sgi.com/projects/ogl-sample/ABI/"
00050 #endif // GL_GLEXT_VERSION
00051 
00052 #if GL_GLEXT_VERSION < 7
00053 #error "I need a newer <GL/glext.h>. Please download it from http://oss.sgi.com/projects/ogl-sample/ABI/"
00054 #endif // GL_GLEXT_VERSION < 7
00055 
00056 namespace       NL3D
00057 {
00058 
00059 
00060 // ***************************************************************************
00062 struct  CGlExtensions
00063 {
00064         // Is this driver a correct OpenGL 1.2 driver?
00065         bool    Version1_2;
00066 
00067         // Required Extensions.
00068         bool    ARBMultiTexture;
00069         sint    NbTextureStages;
00070         bool    EXTTextureEnvCombine;
00071 
00072         // Optionnal Extensions.
00073         bool    ARBTextureCompression;
00074         bool    NVVertexArrayRange;
00075         bool    EXTTextureCompressionS3TC;
00076         bool    EXTVertexWeighting;
00077         bool    EXTSeparateSpecularColor;
00078 
00079 public:
00080         CGlExtensions()
00081         {
00082                 // Fill all false by default.
00083                 Version1_2= false;
00084                 ARBMultiTexture= false;
00085                 NbTextureStages= 1;
00086                 EXTTextureEnvCombine= false;
00087                 ARBTextureCompression= false;
00088                 NVVertexArrayRange= false;
00089                 EXTTextureCompressionS3TC= false;
00090                 EXTVertexWeighting= false;
00091                 EXTSeparateSpecularColor= false;
00092         };
00093 };
00094 
00095 
00096 // ***************************************************************************
00098 void    registerGlExtensions(CGlExtensions &ext);
00099 
00100 
00101 }
00102 
00103 
00104 
00105 // ***************************************************************************
00106 // The exported function names for the windows platform.
00107 #ifdef NL_OS_WINDOWS
00108 
00109 
00110 // ARB_multitexture
00111 //=================
00112 extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
00113 extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
00114 
00115 extern PFNGLMULTITEXCOORD1SARBPROC glMultiTexCoord1sARB;
00116 extern PFNGLMULTITEXCOORD1IARBPROC glMultiTexCoord1iARB;
00117 extern PFNGLMULTITEXCOORD1FARBPROC glMultiTexCoord1fARB;
00118 extern PFNGLMULTITEXCOORD1FARBPROC glMultiTexCoord1fARB;
00119 extern PFNGLMULTITEXCOORD1DARBPROC glMultiTexCoord1dARB;
00120 extern PFNGLMULTITEXCOORD2SARBPROC glMultiTexCoord2sARB;
00121 extern PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB;
00122 extern PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB;
00123 extern PFNGLMULTITEXCOORD2DARBPROC glMultiTexCoord2dARB;
00124 extern PFNGLMULTITEXCOORD3SARBPROC glMultiTexCoord3sARB;
00125 extern PFNGLMULTITEXCOORD3IARBPROC glMultiTexCoord3iARB;
00126 extern PFNGLMULTITEXCOORD3FARBPROC glMultiTexCoord3fARB;
00127 extern PFNGLMULTITEXCOORD3DARBPROC glMultiTexCoord3dARB;
00128 extern PFNGLMULTITEXCOORD4SARBPROC glMultiTexCoord4sARB;
00129 extern PFNGLMULTITEXCOORD4IARBPROC glMultiTexCoord4iARB;
00130 extern PFNGLMULTITEXCOORD4FARBPROC glMultiTexCoord4fARB;
00131 extern PFNGLMULTITEXCOORD4DARBPROC glMultiTexCoord4dARB;
00132 
00133 extern PFNGLMULTITEXCOORD1SVARBPROC glMultiTexCoord1svARB;
00134 extern PFNGLMULTITEXCOORD1IVARBPROC glMultiTexCoord1ivARB;
00135 extern PFNGLMULTITEXCOORD1FVARBPROC glMultiTexCoord1fvARB;
00136 extern PFNGLMULTITEXCOORD1DVARBPROC glMultiTexCoord1dvARB;
00137 extern PFNGLMULTITEXCOORD2SVARBPROC glMultiTexCoord2svARB;
00138 extern PFNGLMULTITEXCOORD2IVARBPROC glMultiTexCoord2ivARB;
00139 extern PFNGLMULTITEXCOORD2FVARBPROC glMultiTexCoord2fvARB;
00140 extern PFNGLMULTITEXCOORD2DVARBPROC glMultiTexCoord2dvARB;
00141 extern PFNGLMULTITEXCOORD3SVARBPROC glMultiTexCoord3svARB;
00142 extern PFNGLMULTITEXCOORD3IVARBPROC glMultiTexCoord3ivARB;
00143 extern PFNGLMULTITEXCOORD3FVARBPROC glMultiTexCoord3fvARB;
00144 extern PFNGLMULTITEXCOORD3DVARBPROC glMultiTexCoord3dvARB;
00145 extern PFNGLMULTITEXCOORD4SVARBPROC glMultiTexCoord4svARB;
00146 extern PFNGLMULTITEXCOORD4IVARBPROC glMultiTexCoord4ivARB;
00147 extern PFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB;
00148 extern PFNGLMULTITEXCOORD4DVARBPROC glMultiTexCoord4dvARB;
00149 
00150 
00151 // ARB_TextureCompression.
00152 //========================
00153 extern PFNGLCOMPRESSEDTEXIMAGE3DARBPROC         glCompressedTexImage3DARB;
00154 extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC         glCompressedTexImage2DARB;
00155 extern PFNGLCOMPRESSEDTEXIMAGE1DARBPROC         glCompressedTexImage1DARB;
00156 extern PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC      glCompressedTexSubImage3DARB;
00157 extern PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC      glCompressedTexSubImage2DARB;
00158 extern PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC      glCompressedTexSubImage1DARB;
00159 extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC        glGetCompressedTexImageARB;
00160 
00161 
00162 // VertexArrayRangeNV.
00163 //====================
00164 typedef void *(APIENTRY * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
00165 extern PFNGLFLUSHVERTEXARRAYRANGENVPROC         glFlushVertexArrayRangeNV;
00166 extern PFNGLVERTEXARRAYRANGENVPROC                      glVertexArrayRangeNV;
00167 extern PFNWGLALLOCATEMEMORYNVPROC                       wglAllocateMemoryNV;
00168 
00169 
00170 // VertexWeighting.
00171 //====================
00172 extern PFNGLVERTEXWEIGHTFEXTPROC                        glVertexWeightfEXT;
00173 extern PFNGLVERTEXWEIGHTFVEXTPROC                       glVertexWeightfvEXT;
00174 extern PFNGLVERTEXWEIGHTPOINTEREXTPROC          glVertexWeightPointerEXT;
00175 
00176 #endif
00177 
00178 
00179 #endif // NL_OPENGL_EXTENSION_H
00180