diff options
-rw-r--r-- | vcl/opengl/salbmp.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index 01072929beb2..4eb1f2714cd8 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -124,6 +124,20 @@ bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long nX, long nY, long VCL_GL_INFO( "OpenGLSalBitmap::Create from FBO: [" << nX << ", " << nY << "] " << nWidth << "x" << nHeight ); + GLint nMaxTextureSize; + glGetIntegerv( GL_MAX_TEXTURE_SIZE, &nMaxTextureSize ); + if ( nWidth > nMaxTextureSize ) + { + nWidth = nMaxTextureSize; + VCL_GL_INFO( "Width limited to " << nMaxTextureSize ); + } + + if ( nHeight > nMaxTextureSize ) + { + nHeight = nMaxTextureSize; + VCL_GL_INFO( "Height limited to " << nMaxTextureSize ); + } + mnWidth = nWidth; mnHeight = nHeight; |