glext.cpp
上传用户:qccn516
上传日期:2013-05-02
资源大小:3382k
文件大小:5k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. /* OpenGL extensions
  2.  *
  3.  * Copyright (C) 2003-2004, Alexander Zaprjagaev <frustum@frustum.org>
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or
  8.  * (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  */
  19. #include "glext.h"
  20. PFNGLACTIVESTENCILFACEEXTPROC glActiveStencilFaceEXT;
  21. PFNGLACTIVETEXTUREARBPROC glActiveTexture;
  22. PFNGLTEXIMAGE3DPROC glTexImage3D;
  23. PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
  24. PFNGLBINDPROGRAMARBPROC glBindProgramARB;
  25. PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
  26. PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
  27. PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB;
  28. PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB;
  29. PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
  30. PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
  31. PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
  32. PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
  33. PFNGLGENPROGRAMSNVPROC glGenProgramsNV;
  34. PFNGLBINDPROGRAMNVPROC glBindProgramNV;
  35. PFNGLDELETEPROGRAMSNVPROC glDeleteProgramsNV;
  36. PFNGLLOADPROGRAMNVPROC glLoadProgramNV;
  37. PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC glProgramNamedParameter4fvNV;
  38. PFNGLGENBUFFERSARBPROC glGenBuffersARB;
  39. PFNGLBINDBUFFERARBPROC glBindBufferARB;
  40. PFNGLBUFFERDATAARBPROC glBufferDataARB;
  41. PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
  42. PFNGLGENQUERIESARBPROC glGenQueriesARB;
  43. PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
  44. PFNGLBEGINQUERYARBPROC glBeginQueryARB;
  45. PFNGLENDQUERYARBPROC glEndQueryARB;
  46. PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
  47. void glext_init() {
  48. glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)wglGetProcAddress("glActiveStencilFaceEXT");
  49. glActiveTexture = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress("glActiveTexture");
  50. glTexImage3D = (PFNGLTEXIMAGE3DPROC)wglGetProcAddress("glTexImage3D");
  51. glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)wglGetProcAddress("glGenProgramsARB");
  52. glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)wglGetProcAddress("glBindProgramARB");
  53. glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)wglGetProcAddress("glDeleteProgramsARB");
  54. glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)wglGetProcAddress("glProgramStringARB");
  55. glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)wglGetProcAddress("glProgramEnvParameter4fvARB");
  56. glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)wglGetProcAddress("glProgramLocalParameter4fvARB");
  57. glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)wglGetProcAddress("glEnableVertexAttribArrayARB");
  58. glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)wglGetProcAddress("glVertexAttribPointerARB");
  59. glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)wglGetProcAddress("glDisableVertexAttribArrayARB");
  60. glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)wglGetProcAddress("glVertexAttrib4fvARB");
  61. glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)wglGetProcAddress("glGenProgramsNV");
  62. glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)wglGetProcAddress("glBindProgramNV");
  63. glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)wglGetProcAddress("glDeleteProgramsNV");
  64. glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)wglGetProcAddress("glLoadProgramNV");
  65. glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)wglGetProcAddress("glProgramNamedParameter4fvNV");
  66. glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)wglGetProcAddress("glGenBuffersARB");
  67. glBindBufferARB = (PFNGLBINDBUFFERARBPROC)wglGetProcAddress("glBindBufferARB");
  68. glBufferDataARB = (PFNGLBUFFERDATAARBPROC)wglGetProcAddress("glBufferDataARB");
  69. glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)wglGetProcAddress("glDeleteBuffersARB");
  70. glGenQueriesARB = (PFNGLGENQUERIESARBPROC)wglGetProcAddress("glGenQueriesARB");
  71. glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)wglGetProcAddress("glDeleteQueriesARB");
  72. glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)wglGetProcAddress("glBeginQueryARB");
  73. glEndQueryARB = (PFNGLENDQUERYARBPROC)wglGetProcAddress("glEndQueryARB");
  74. glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)wglGetProcAddress("glGetQueryObjectuivARB");
  75. }