comparison Framework/OpenGL/OpenGLIncludes.h @ 1045:6a9300ecfa13

tests for context loss are now restricted to WebAssembly
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Oct 2019 17:17:56 +0200
parents 3ea70a62ca00
children bc27c199eefe 2d8ab34c8c91
comparison
equal deleted inserted replaced
1044:b60d70e8b55c 1045:6a9300ecfa13
56 56
57 // glGetError is very expensive! 57 // glGetError is very expensive!
58 58
59 # define ORTHANC_OPENGL_CHECK(name) 59 # define ORTHANC_OPENGL_CHECK(name)
60 # define ORTHANC_OPENGL_TRACE_CURRENT_CONTEXT(msg) 60 # define ORTHANC_OPENGL_TRACE_CURRENT_CONTEXT(msg)
61 # define ORTHANC_CHECK_CURRENT_CONTEXT(context)
62 61
63 # else 62 # else
64 63
65 # define ORTHANC_OPENGL_CHECK(name) \ 64 # define ORTHANC_OPENGL_CHECK(name) \
66 if(true) \ 65 if(true) \
76 # define ORTHANC_OPENGL_TRACE_CURRENT_CONTEXT(msg) \ 75 # define ORTHANC_OPENGL_TRACE_CURRENT_CONTEXT(msg) \
77 if(true) \ 76 if(true) \
78 { \ 77 { \
79 SDL_GLContext ctx = SDL_GL_GetCurrentContext(); \ 78 SDL_GLContext ctx = SDL_GL_GetCurrentContext(); \
80 LOG(TRACE) << msg << " | Current OpenGL context is " << std::hex << ctx; \ 79 LOG(TRACE) << msg << " | Current OpenGL context is " << std::hex << ctx; \
81 } else (void)0
82
83 # define ORTHANC_CHECK_CURRENT_CONTEXT(context) \
84 if(true) \
85 { \
86 SDL_GLContext actualCtx = SDL_GL_GetCurrentContext(); \
87 void* expectedCtx = context.DebugGetInternalContext(); \
88 if(expectedCtx != actualCtx) \
89 { \
90 LOG(ERROR) << "Expected context was " << std::hex << expectedCtx << " while actual context is " << std::hex << actualCtx; \
91 } \
92 } else (void)0 80 } else (void)0
93 81
94 # endif 82 # endif
95 83
96 #endif 84 #endif