Advertisement
Kitomas

_gl_err.hpp as of 2024-02-08

Feb 9th, 2024
887
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.98 KB | None | 0 0
  1. //assumes glew is being used
  2. #pragma once
  3.  
  4.  
  5. //currently included functions:
  6. /*
  7. glCreateShader
  8. glShaderSource
  9. glCompileShader
  10. glGetShaderiv
  11. glGetShaderInfoLog
  12. glDeleteShader
  13. glCreateProgram
  14. glAttachShader
  15. glLinkProgram
  16. glValidateProgram
  17. glDeleteShader
  18. glViewport
  19. glGetString
  20. glGetIntegerv
  21. glGenBuffers
  22. glBindBuffer
  23. glBufferData
  24. glEnableVertexAttribArray
  25. glVertexAttribPointer
  26. glUseProgram
  27. glClear
  28. glDrawArrays
  29. glDeleteProgram
  30. */
  31.  
  32.  
  33. #if defined(_DEBUG)
  34.  
  35.  
  36. #ifdef    glCreateShader
  37. #undef    glCreateShader
  38. #define   glCreateShader(...) \
  39.   GLEW_GET_FUN(__glewCreateShader)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  40. #endif /* glCreateShader */
  41.  
  42. #ifdef    glShaderSource
  43. #undef    glShaderSource
  44. #define   glShaderSource(...) \
  45.   GLEW_GET_FUN(__glewShaderSource)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  46. #endif /* glShaderSource */
  47.  
  48. #ifdef    glCompileShader
  49. #undef    glCompileShader
  50. #define   glCompileShader(...) \
  51.   GLEW_GET_FUN(__glewCompileShader)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  52. #endif /* glCompileShader */
  53.  
  54. #ifdef    glGetShaderiv
  55. #undef    glGetShaderiv
  56. #define   glGetShaderiv(...) \
  57.   GLEW_GET_FUN(__glewGetShaderiv)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  58. #endif /* glGetShaderiv */
  59.  
  60. #ifdef    glGetShaderInfoLog
  61. #undef    glGetShaderInfoLog
  62. #define   glGetShaderInfoLog(...) \
  63.   GLEW_GET_FUN(__glewGetShaderInfoLog)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  64. #endif /* glGetShaderInfoLog */
  65.  
  66. #ifdef    glDeleteShader
  67. #undef    glDeleteShader
  68. #define   glDeleteShader(...) \
  69.   GLEW_GET_FUN(__glewDeleteShader)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  70. #endif /* glDeleteShader */
  71.  
  72. #ifdef    glCreateProgram
  73. #undef    glCreateProgram
  74. #define   glCreateProgram(...) \
  75.   GLEW_GET_FUN(__glewCreateProgram)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  76. #endif /* glCreateProgram */
  77.  
  78. #ifdef    glAttachShader
  79. #undef    glAttachShader
  80. #define   glAttachShader(...) \
  81.   GLEW_GET_FUN(__glewAttachShader)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  82. #endif /* glAttachShader */
  83.  
  84. #ifdef    glLinkProgram
  85. #undef    glLinkProgram
  86. #define   glLinkProgram(...) \
  87.   GLEW_GET_FUN(__glewLinkProgram)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  88. #endif /* glLinkProgram */
  89.  
  90. #ifdef    glValidateProgram
  91. #undef    glValidateProgram
  92. #define   glValidateProgram(...) \
  93.   GLEW_GET_FUN(__glewValidateProgram)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  94. #endif /* glValidateProgram */
  95.  
  96. #ifdef    glDeleteShader
  97. #undef    glDeleteShader
  98. #define   glDeleteShader(...) \
  99.   GLEW_GET_FUN(__glewDeleteShader)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  100. #endif /* glDeleteShader */
  101.  
  102. #ifdef    glViewport
  103. #undef    glViewport
  104. #define   glViewport(...) \
  105.   GLEW_GET_FUN(__glewViewport)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  106. #endif /* glViewport */
  107.  
  108. #ifdef    glGetString
  109. #undef    glGetString
  110. #define   glGetString(...) \
  111.   GLEW_GET_FUN(__glewGetString)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  112. #endif /* glGetString */
  113.  
  114. #ifdef    glGetIntegerv
  115. #undef    glGetIntegerv
  116. #define   glGetIntegerv(...) \
  117.   GLEW_GET_FUN(__glewGetIntegerv)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  118. #endif /* glGetIntegerv */
  119.  
  120. #ifdef    glGenBuffers
  121. #undef    glGenBuffers
  122. #define   glGenBuffers(...) \
  123.   GLEW_GET_FUN(__glewGenBuffers)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  124. #endif /* glGenBuffers */
  125.  
  126. #ifdef    glBindBuffer
  127. #undef    glBindBuffer
  128. #define   glBindBuffer(...) \
  129.   GLEW_GET_FUN(__glewBindBuffer)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  130. #endif /* glBindBuffer */
  131.  
  132. #ifdef    glBufferData
  133. #undef    glBufferData
  134. #define   glBufferData(...) \
  135.   GLEW_GET_FUN(__glewBufferData)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  136. #endif /* glBufferData */
  137.  
  138. #ifdef    glEnableVertexAttribArray
  139. #undef    glEnableVertexAttribArray
  140. #define   glEnableVertexAttribArray(...) \
  141.   GLEW_GET_FUN(__glewEnableVertexAttribArray)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  142. #endif /* glEnableVertexAttribArray */
  143.  
  144. #ifdef    glVertexAttribPointer
  145. #undef    glVertexAttribPointer
  146. #define   glVertexAttribPointer(...) \
  147.   GLEW_GET_FUN(__glewVertexAttribPointer)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  148. #endif /* glVertexAttribPointer */
  149.  
  150. #ifdef    glUseProgram
  151. #undef    glUseProgram
  152. #define   glUseProgram(...) \
  153.   GLEW_GET_FUN(__glewUseProgram)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  154. #endif /* glUseProgram */
  155.  
  156. #ifdef    glClear
  157. #undef    glClear
  158. #define   glClear(...) \
  159.   GLEW_GET_FUN(__glewClear)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  160. #endif /* glClear */
  161.  
  162. #ifdef    glDrawArrays
  163. #undef    glDrawArrays
  164. #define   glDrawArrays(...) \
  165.   GLEW_GET_FUN(__glewDrawArrays)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  166. #endif /* glDrawArrays */
  167.  
  168. #ifdef    glDeleteProgram
  169. #undef    glDeleteProgram
  170. #define   glDeleteProgram(...) \
  171.   GLEW_GET_FUN(__glewDeleteProgram)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
  172. #endif /* glDeleteProgram */
  173.  
  174.  
  175. #endif
  176.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement