summaryrefslogtreecommitdiff
path: root/src/resources/openglimagehelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/openglimagehelper.cpp')
-rw-r--r--src/resources/openglimagehelper.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index 111dbe58e..9e3e5dc2d 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -474,11 +474,24 @@ void OpenGLImageHelper::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);