glext.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. Copyright (C) 2005, 2010 - Cryptic Sea
  3. This file is part of Gish.
  4. Gish is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. See the GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. void loadglextentions(void)
  17. {
  18. char *ext;
  19. char *glversion;
  20. glversion=(char *) glGetString(GL_VERSION);
  21. ext=(char *) glGetString(GL_EXTENSIONS);
  22. #ifdef WINDOZE
  23. if (strstr(ext,"GL_ARB_multitexture")!=NULL || SDL_GL_GetProcAddress("glActiveTextureARB")!=NULL)
  24. {
  25. glActiveTextureARB=(void *) SDL_GL_GetProcAddress("glActiveTextureARB");
  26. glClientActiveTextureARB=(void *) SDL_GL_GetProcAddress("glClientActiveTextureARB");
  27. glMultiTexCoord2fARB=(void *) SDL_GL_GetProcAddress("glMultiTexCoord2fARB");
  28. glMultiTexCoord2fvARB=(void *) SDL_GL_GetProcAddress("glMultiTexCoord2fvARB");
  29. glMultiTexCoord3fARB=(void *) SDL_GL_GetProcAddress("glMultiTexCoord3fARB");
  30. glMultiTexCoord4fARB=(void *) SDL_GL_GetProcAddress("glMultiTexCoord4fARB");
  31. glext.multitexture=1;
  32. }
  33. else if ((glActiveTextureARB=(void *) SDL_GL_GetProcAddress("glActiveTexture"))!=NULL)
  34. {
  35. glClientActiveTextureARB=(void *) SDL_GL_GetProcAddress("glClientActiveTexture");
  36. glMultiTexCoord2fARB=(void *) SDL_GL_GetProcAddress("glMultiTexCoord2f");
  37. glMultiTexCoord2fvARB=(void *) SDL_GL_GetProcAddress("glMultiTexCoord2fv");
  38. glMultiTexCoord3fARB=(void *) SDL_GL_GetProcAddress("glMultiTexCoord3f");
  39. glMultiTexCoord4fARB=(void *) SDL_GL_GetProcAddress("glMultiTexCoord4f");
  40. glext.multitexture=1;
  41. }
  42. #endif
  43. #ifndef WINDOZE
  44. glext.multitexture=1;
  45. #endif
  46. if (strstr(ext,"GL_ARB_texture_env_dot3")!=NULL || (glversion[0]>='2' || glversion[2]>='3'))
  47. glext.texture_env_dot3=1;
  48. }