diff options
Diffstat (limited to 'src/resources/safeopenglimagehelper.cpp')
-rw-r--r-- | src/resources/safeopenglimagehelper.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/resources/safeopenglimagehelper.cpp b/src/resources/safeopenglimagehelper.cpp index 41b2c5d89..c57e2a104 100644 --- a/src/resources/safeopenglimagehelper.cpp +++ b/src/resources/safeopenglimagehelper.cpp @@ -473,11 +473,24 @@ void SafeOpenGLImageHelper::copySurfaceToImage(const Image *const image, if (!surface) return; - mglTextureSubImage2D(image->mGLImage, - mTextureType, 0, - x, y, - surface->w, surface->h, - GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels); + // +++ probably need combine + // mglTextureSubImage2D and mglTextureSubImage2DEXT + if (mglTextureSubImage2D) + { + mglTextureSubImage2D(image->mGLImage, + 0, + x, y, + surface->w, surface->h, + GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels); + } + else + { + mglTextureSubImage2DEXT(image->mGLImage, + mTextureType, 0, + x, y, + surface->w, surface->h, + GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels); + } if (surface != oldSurface) MSDL_FreeSurface(surface); |