From 4504693a4cacd273b2c5610b793aeb6af748ad09 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 22 Feb 2012 03:53:13 +0100 Subject: Fix VBORegion2PES2: Don't exceed MAQX_TEXTURE_SIZE --- src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java index 758d0e999..4c664e883 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java @@ -190,10 +190,18 @@ public class VBORegion2PES2 extends GLRegion { // the buffers were disabled, since due to real/fbo switching and other vbo usage } + int[] maxTexSize = new int[] { -1 } ; + protected void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int width) { if(vp_width <=0 || vp_height <= 0 || width <= 0){ renderRegion(gl); } else { + if(0 > maxTexSize[0]) { + gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, maxTexSize, 0); + } + if(width > maxTexSize[0]) { + width = maxTexSize[0]; + } if(width != tex_width_c) { renderRegion2FBO(gl, rs, width); } -- cgit v1.2.3