aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-03-14 08:13:42 +0100
committerSven Gothel <[email protected]>2014-03-14 08:13:42 +0100
commite16e974a3e2b38c65355838eeb010954354097d2 (patch)
treee1582436012d80ffddb5a81e6056a5aaa4e7368b /src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
parent70979247aad156418c32959bbf4962f175191ec2 (diff)
Bug 801: Add Frustum support to Region; Misc ..
Region: Add Frustum support, to drop 'out of sight' shapes RenderState: Add hints, e.g. BITHINT_BLENDING_ENABLED, allowing user code to toggle background color etc Demos: Incomplete - WIP - Reuse mapped object to window coords computed at reshape - TODO: Use minimal Scenegraph for Graph-UI ..
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index bdf824b6a..e45e623ba 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -81,7 +81,7 @@ public class VBORegionSPES2 extends GLRegion {
}
@Override
- protected void update(final GL2ES2 gl, final RegionRenderer renderer) {
+ protected void updateImpl(final GL2ES2 gl, final RegionRenderer renderer) {
if( !buffersAttached ) {
final ShaderState st = renderer.getShaderState();
st.ownAttribute(verticeAttr, true);
@@ -104,6 +104,12 @@ public class VBORegionSPES2 extends GLRegion {
@Override
protected void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, final int[/*1*/] sampleCount) {
+ if( 0 >= indicesBuffer.getElementCount() ) {
+ if(DEBUG_INSTANCE) {
+ System.err.printf("VBORegionSPES2.drawImpl: Empty%n");
+ }
+ return; // empty!
+ }
verticeAttr.enableBuffer(gl, true);
texCoordAttr.enableBuffer(gl, true);
indicesBuffer.bindBuffer(gl, true); // keeps VBO binding