Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.9 KiB

  1. //============ Copyright (c) Valve Corporation, All rights reserved. ============
  2. //
  3. // glmgrext.h
  4. // helper file for extension testing and runtime importing of entry points
  5. //
  6. //===============================================================================
  7. #pragma once
  8. #include <OpenGL/gl.h>
  9. #include <OpenGL/glext.h>
  10. // #define symbol INSTANTIATE_GL_IMPORTS controls whether the following macro "GL_IMPORT" writes externs or writes decls
  11. // normally only glmgr.cpp sets that symbol and includes this file
  12. // to simplify usage, a function ptr type must exist for every entry point, following the name##FuncPtr convention.
  13. #ifdef INSTANTIATE_GL_IMPORTS
  14. #define GL_IMPORT( name ) name##FuncPtr name = 0
  15. #else
  16. #define GL_IMPORT( name ) extern name##FuncPtr name;
  17. #endif
  18. // before declaring each import, check to see if the EXT symbol is in effect,
  19. // and if so, don't do it!
  20. #ifndef GL_EXT_draw_buffers2
  21. typedef void (* glColorMaskIndexedEXTFuncPtr) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
  22. typedef void (* glEnableIndexedEXTFuncPtr) (GLenum target, GLuint index);
  23. typedef void (* glDisableIndexedEXTFuncPtr) (GLenum target, GLuint index);
  24. GL_IMPORT(glColorMaskIndexedEXT);
  25. GL_IMPORT(glEnableIndexedEXT);
  26. GL_IMPORT(glDisableIndexedEXT);
  27. #endif
  28. #ifndef GL_EXT_framebuffer_sRGB
  29. #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
  30. #define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
  31. #endif
  32. #ifndef ARB_texture_rg
  33. #define GL_COMPRESSED_RED 0x8225
  34. #define GL_COMPRESSED_RG 0x8226
  35. #define GL_RG 0x8227
  36. #define GL_RG_INTEGER 0x8228
  37. #define GL_R8 0x8229
  38. #define GL_R16 0x822A
  39. #define GL_RG8 0x822B
  40. #define GL_RG16 0x822C
  41. #define GL_R16F 0x822D
  42. #define GL_R32F 0x822E
  43. #define GL_RG16F 0x822F
  44. #define GL_RG32F 0x8230
  45. #define GL_R8I 0x8231
  46. #define GL_R8UI 0x8232
  47. #define GL_R16I 0x8233
  48. #define GL_R16UI 0x8234
  49. #define GL_R32I 0x8235
  50. #define GL_R32UI 0x8236
  51. #define GL_RG8I 0x8237
  52. #define GL_RG8UI 0x8238
  53. #define GL_RG16I 0x8239
  54. #define GL_RG16UI 0x823A
  55. #define GL_RG32I 0x823B
  56. #define GL_RG32UI 0x823C
  57. #define GL_RGB10_A2UI_ARB 0x906F
  58. #endif
  59. #ifndef GL_EXT_bindable_uniform
  60. #define GL_UNIFORM_BUFFER_EXT 0x8DEE
  61. #endif
  62. // unpublished extension enums (thus the "X")
  63. // from EXT_framebuffer_multisample_blit_scaled..
  64. #define XGL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
  65. #define XGL_SCALED_RESOLVE_NICEST_EXT 0x90BB
  66. void * NSGLGetProcAddress (const char *name);
  67. // call this to find all the entry points.
  68. void GLMSetupExtensions( void );
  69. typedef void (*PFNglColorMaskIndexedEXT)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
  70. typedef void (*PFNglEnableIndexedEXT)(GLenum target, GLuint index);
  71. typedef void (*PFNglDisableIndexedEXT)(GLenum target, GLuint index);
  72. typedef void (*PFNglUniformBufferEXT)(GLuint program, GLint location, GLuint buffer);
  73. extern PFNglColorMaskIndexedEXT pfnglColorMaskIndexedEXT;
  74. extern PFNglEnableIndexedEXT pfnglEnableIndexedEXT;
  75. extern PFNglDisableIndexedEXT pfnglDisableIndexedEXT;
  76. extern PFNglUniformBufferEXT pfnglUniformBufferEXT;
  77. typedef void (*PFNglGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params);
  78. extern PFNglGetFramebufferAttachmentParameteriv pfnglGetFramebufferAttachmentParameteriv;