Created
June 6, 2012 09:07
-
-
Save matricks/2880815 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct SGfxGlCallInfo | |
| { | |
| unsigned m_ErrorCount; | |
| const char *m_pCallCode; | |
| const char *m_pFilename; | |
| int m_LineNumber; | |
| }; | |
| void GfxCheckGlError(SGfxGlCallInfo *pCallInfo) | |
| { | |
| int ErrorCode = glGetError(); | |
| if(ErrorCode) | |
| { | |
| if(pCallInfo->m_ErrorCount == 0) | |
| { | |
| dbg_msg("gl", "%s:%d\n\t%s", pCallInfo->m_pFilename, pCallInfo->m_LineNumber, pCallInfo->m_pCallCode); | |
| } | |
| pCallInfo->m_ErrorCount++; | |
| } | |
| } | |
| #define GLCALL(x) x; \ | |
| { \ | |
| static SGfxGlCallInfo CallInfo = {0, #x, __FILE__, __LINE__}; \ | |
| GfxCheckGlError(&CallInfo); \ | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment