diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-04-25 16:55:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-04-25 16:55:35 +0300 |
commit | 4821f538a888370eb80ec28f9bab269a4427a63c (patch) | |
tree | 8e78fcb52df8b10cdd4cd2ed3859ad29c4c4c711 /src/resources | |
parent | 51b81830c032fe255254a269b85679a89aa3728d (diff) | |
download | manaverse-4821f538a888370eb80ec28f9bab269a4427a63c.tar.gz manaverse-4821f538a888370eb80ec28f9bab269a4427a63c.tar.bz2 manaverse-4821f538a888370eb80ec28f9bab269a4427a63c.tar.xz manaverse-4821f538a888370eb80ec28f9bab269a4427a63c.zip |
Report into log OpenGL errors if enabled configure option --enable-openglerrors.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/openglimagehelper.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp index 9af9c6643..391c3b9b5 100644 --- a/src/resources/openglimagehelper.cpp +++ b/src/resources/openglimagehelper.cpp @@ -339,6 +339,9 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage, mUseOpenGL != RENDER_GLES2_OPENGL) { glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); +#ifdef OPENGLERRORS + graphicsManager.logError(); +#endif // OPENGLERRORS } if (!mUseTextureSampler) @@ -346,12 +349,26 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage, if (mBlur) { mglTexParameteri(mTextureType, GL_TEXTURE_MIN_FILTER, GL_LINEAR); +#ifdef OPENGLERRORS + graphicsManager.logError(); +#endif // OPENGLERRORS + mglTexParameteri(mTextureType, GL_TEXTURE_MAG_FILTER, GL_LINEAR); +#ifdef OPENGLERRORS + graphicsManager.logError(); +#endif // OPENGLERRORS } else { mglTexParameteri(mTextureType, GL_TEXTURE_MIN_FILTER, GL_NEAREST); +#ifdef OPENGLERRORS + graphicsManager.logError(); +#endif // OPENGLERRORS + mglTexParameteri(mTextureType, GL_TEXTURE_MAG_FILTER, GL_NEAREST); +#ifdef OPENGLERRORS + graphicsManager.logError(); +#endif // OPENGLERRORS } } #if !defined(ANDROID) && !defined(__native_client__) @@ -361,6 +378,9 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage, mglTexImage2D(mTextureType, 0, mInternalTextureType, tmpImage->w, tmpImage->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->pixels); +#ifdef OPENGLERRORS + graphicsManager.logError(); +#endif // OPENGLERRORS #ifdef DEBUG_OPENGL /* @@ -499,6 +519,9 @@ void OpenGLImageHelper::copySurfaceToImage(const Image *const image, surface->w, surface->h, GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels); } +#ifdef OPENGLERRORS + graphicsManager.logError(); +#endif // OPENGLERRORS if (surface != oldSurface) MSDL_FreeSurface(surface); |