From e03c5a17f1e6ebe7c8581469f35feb67a7100d15 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Fri, 12 Oct 2012 22:01:24 +0200
Subject: FixedFuncHook: Add ES2 alignment of certain GL functions, i.e.
 GL_QUAD_STRIP/GL_POLYGON/GL_QUADS mapping, glTexImage2D internalformat/format
 match.

---
 src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/jogl/classes/com/jogamp/opengl/util')

diff --git a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
index 238e402d1..1292a9298 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
@@ -422,12 +422,12 @@ public class ImmModeSink {
                 if ( GL_QUADS == mode && !gl.isGL2() ) {
                     if( GL.GL_UNSIGNED_BYTE == type ) {
                         final ByteBuffer b = (ByteBuffer) indices;
-                        for (int j = 0; j < b.remaining(); j++) {
+                        for (int j = b.position(); j < b.remaining(); j++) {
                             gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x000000ff & b.get(j)), 4);
                         }                        
                     } else {
                         final ShortBuffer b = (ShortBuffer) indices;
-                        for (int j = 0; j < b.remaining(); j++) {
+                        for (int j = b.position(); j < b.remaining(); j++) {
                             gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x0000ffff & b.get(j)), 4);
                         }                                                
                     }
-- 
cgit v1.2.3