diff --git a/Externals/SOIL/SOIL.c b/Externals/SOIL/SOIL.c index e9f292daf5..d539ec173b 100644 --- a/Externals/SOIL/SOIL.c +++ b/Externals/SOIL/SOIL.c @@ -975,11 +975,11 @@ unsigned int void check_for_GL_errors( const char *calling_location ) { /* check for errors */ - GLenum err_code = glGetError(); + GLenum err_code = GL_REPORT_ERROR(); while( GL_NO_ERROR != err_code ) { printf( "OpenGL Error @ %s: %i", calling_location, err_code ); - err_code = glGetError(); + err_code = GL_REPORT_ERROR(); } } #else diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h index 303b921efd..391e233d34 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h @@ -116,19 +116,15 @@ void OpenGL_ReportARBProgramError(); GLuint OpenGL_ReportGLError(const char *function, const char *file, int line); bool OpenGL_ReportFBOError(const char *function, const char *file, int line); -#if 1 +#if defined(_DEBUG) || defined(DEBUGFAST) #define GL_REPORT_ERROR() OpenGL_ReportGLError (__FUNCTION__, __FILE__, __LINE__) #define GL_REPORT_PROGRAM_ERROR() OpenGL_ReportARBProgramError() #define GL_REPORT_FBO_ERROR() OpenGL_ReportFBOError (__FUNCTION__, __FILE__, __LINE__) +#define GL_REPORT_ERRORD() OpenGL_ReportGLError(__FUNCTION__, __FILE__, __LINE__) #else #define GL_REPORT_ERROR() GL_NO_ERROR #define GL_REPORT_PROGRAM_ERROR() #define GL_REPORT_FBO_ERROR() -#endif - -#if defined(_DEBUG) || defined(DEBUGFAST) -#define GL_REPORT_ERRORD() OpenGL_ReportGLError(__FUNCTION__, __FILE__, __LINE__) -#else #define GL_REPORT_ERRORD() #endif diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 616e4f3806..631158a14b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -198,7 +198,7 @@ void SetDefaultRectTexParams() // Set some standard texture filter modes. glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - if (glGetError() != GL_NO_ERROR) { + if (GL_REPORT_ERROR() != GL_NO_ERROR) { glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); GL_REPORT_ERRORD(); @@ -479,7 +479,7 @@ bool Renderer::Init() glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); UpdateActiveConfig(); - return glGetError() == GL_NO_ERROR && bSuccess; + return GL_REPORT_ERROR() == GL_NO_ERROR && bSuccess; } void Renderer::Shutdown(void) @@ -1058,7 +1058,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons u8 *data = (u8 *) malloc(3 * w * h); glPixelStorei(GL_PACK_ALIGNMENT, 1); glReadPixels(back_rc.left, back_rc.bottom, w, h, GL_BGR, GL_UNSIGNED_BYTE, data); - if (glGetError() == GL_NO_ERROR && w > 0 && h > 0) + if (GL_REPORT_ERROR() == GL_NO_ERROR && w > 0 && h > 0) { if (!s_bLastFrameDumped) { @@ -1102,7 +1102,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons u8 *data = (u8 *) malloc(3 * w * h); glPixelStorei(GL_PACK_ALIGNMENT, 1); glReadPixels(back_rc.left, back_rc.bottom, w, h, GL_BGR, GL_UNSIGNED_BYTE, data); - if (glGetError() == GL_NO_ERROR) { + if (GL_REPORT_ERROR() == GL_NO_ERROR) { if (!s_bLastFrameDumped) { sprintf(movie_file_name, "%sframedump.raw", File::GetUserPath(D_DUMPFRAMES_IDX)); f_pFrameDump = fopen(movie_file_name, "wb"); @@ -1522,7 +1522,7 @@ bool Renderer::SaveRenderTarget(const char *filename, TargetRectangle back_rc) glReadPixels(back_rc.left, back_rc.bottom, W, H, GL_RGB, GL_UNSIGNED_BYTE, data); // Show failure message - if (glGetError() != GL_NO_ERROR) + if (GL_REPORT_ERROR() != GL_NO_ERROR) { OSD::AddMessage("Error capturing or saving screenshot.", 2000); return false; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp index d80f5814dc..c558d1f9a9 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp @@ -792,7 +792,7 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - if (glGetError() != GL_NO_ERROR) { + if (GL_REPORT_ERROR() != GL_NO_ERROR) { glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); GL_REPORT_ERRORD(); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h index 8410aaa004..76afba992d 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h @@ -110,19 +110,15 @@ void OpenGL_ReportARBProgramError(); GLuint OpenGL_ReportGLError(const char *function, const char *file, int line); bool OpenGL_ReportFBOError(const char *function, const char *file, int line); -#if 1 +#if defined(_DEBUG) || defined(DEBUGFAST) #define GL_REPORT_ERROR() OpenGL_ReportGLError (__FUNCTION__, __FILE__, __LINE__) #define GL_REPORT_PROGRAM_ERROR() OpenGL_ReportARBProgramError() #define GL_REPORT_FBO_ERROR() OpenGL_ReportFBOError (__FUNCTION__, __FILE__, __LINE__) +#define GL_REPORT_ERRORD() OpenGL_ReportGLError(__FUNCTION__, __FILE__, __LINE__) #else #define GL_REPORT_ERROR() GL_NO_ERROR #define GL_REPORT_PROGRAM_ERROR() #define GL_REPORT_FBO_ERROR() -#endif - -#if defined(_DEBUG) || defined(DEBUGFAST) -#define GL_REPORT_ERRORD() OpenGL_ReportGLError(__FUNCTION__, __FILE__, __LINE__) -#else #define GL_REPORT_ERRORD() #endif