Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //assumes glew is being used
- #pragma once
- //currently included functions:
- /*
- glCreateShader
- glShaderSource
- glCompileShader
- glGetShaderiv
- glGetShaderInfoLog
- glDeleteShader
- glCreateProgram
- glAttachShader
- glLinkProgram
- glValidateProgram
- glDeleteShader
- glViewport
- glGetString
- glGetIntegerv
- glGenBuffers
- glBindBuffer
- glBufferData
- glEnableVertexAttribArray
- glVertexAttribPointer
- glUseProgram
- glClear
- glDrawArrays
- glDeleteProgram
- */
- #if defined(_DEBUG)
- #ifdef glCreateShader
- #undef glCreateShader
- #define glCreateShader(...) \
- GLEW_GET_FUN(__glewCreateShader)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glCreateShader */
- #ifdef glShaderSource
- #undef glShaderSource
- #define glShaderSource(...) \
- GLEW_GET_FUN(__glewShaderSource)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glShaderSource */
- #ifdef glCompileShader
- #undef glCompileShader
- #define glCompileShader(...) \
- GLEW_GET_FUN(__glewCompileShader)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glCompileShader */
- #ifdef glGetShaderiv
- #undef glGetShaderiv
- #define glGetShaderiv(...) \
- GLEW_GET_FUN(__glewGetShaderiv)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glGetShaderiv */
- #ifdef glGetShaderInfoLog
- #undef glGetShaderInfoLog
- #define glGetShaderInfoLog(...) \
- GLEW_GET_FUN(__glewGetShaderInfoLog)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glGetShaderInfoLog */
- #ifdef glDeleteShader
- #undef glDeleteShader
- #define glDeleteShader(...) \
- GLEW_GET_FUN(__glewDeleteShader)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glDeleteShader */
- #ifdef glCreateProgram
- #undef glCreateProgram
- #define glCreateProgram(...) \
- GLEW_GET_FUN(__glewCreateProgram)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glCreateProgram */
- #ifdef glAttachShader
- #undef glAttachShader
- #define glAttachShader(...) \
- GLEW_GET_FUN(__glewAttachShader)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glAttachShader */
- #ifdef glLinkProgram
- #undef glLinkProgram
- #define glLinkProgram(...) \
- GLEW_GET_FUN(__glewLinkProgram)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glLinkProgram */
- #ifdef glValidateProgram
- #undef glValidateProgram
- #define glValidateProgram(...) \
- GLEW_GET_FUN(__glewValidateProgram)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glValidateProgram */
- #ifdef glDeleteShader
- #undef glDeleteShader
- #define glDeleteShader(...) \
- GLEW_GET_FUN(__glewDeleteShader)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glDeleteShader */
- #ifdef glViewport
- #undef glViewport
- #define glViewport(...) \
- GLEW_GET_FUN(__glewViewport)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glViewport */
- #ifdef glGetString
- #undef glGetString
- #define glGetString(...) \
- GLEW_GET_FUN(__glewGetString)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glGetString */
- #ifdef glGetIntegerv
- #undef glGetIntegerv
- #define glGetIntegerv(...) \
- GLEW_GET_FUN(__glewGetIntegerv)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glGetIntegerv */
- #ifdef glGenBuffers
- #undef glGenBuffers
- #define glGenBuffers(...) \
- GLEW_GET_FUN(__glewGenBuffers)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glGenBuffers */
- #ifdef glBindBuffer
- #undef glBindBuffer
- #define glBindBuffer(...) \
- GLEW_GET_FUN(__glewBindBuffer)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glBindBuffer */
- #ifdef glBufferData
- #undef glBufferData
- #define glBufferData(...) \
- GLEW_GET_FUN(__glewBufferData)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glBufferData */
- #ifdef glEnableVertexAttribArray
- #undef glEnableVertexAttribArray
- #define glEnableVertexAttribArray(...) \
- GLEW_GET_FUN(__glewEnableVertexAttribArray)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glEnableVertexAttribArray */
- #ifdef glVertexAttribPointer
- #undef glVertexAttribPointer
- #define glVertexAttribPointer(...) \
- GLEW_GET_FUN(__glewVertexAttribPointer)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glVertexAttribPointer */
- #ifdef glUseProgram
- #undef glUseProgram
- #define glUseProgram(...) \
- GLEW_GET_FUN(__glewUseProgram)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glUseProgram */
- #ifdef glClear
- #undef glClear
- #define glClear(...) \
- GLEW_GET_FUN(__glewClear)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glClear */
- #ifdef glDrawArrays
- #undef glDrawArrays
- #define glDrawArrays(...) \
- GLEW_GET_FUN(__glewDrawArrays)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glDrawArrays */
- #ifdef glDeleteProgram
- #undef glDeleteProgram
- #define glDeleteProgram(...) \
- GLEW_GET_FUN(__glewDeleteProgram)(__VA_ARGS__); gl::errLogAll(__LINE__,__FILE__);
- #endif /* glDeleteProgram */
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement