Examples of glDrawElements()


Examples of javax.media.opengl.GL.glDrawElements()

            final int glIndexMode = getGLIndexMode(indexModes[0]);

            final int type = getGLDataType(indices);

            if (primcount < 0) {
                gl.glDrawElements(glIndexMode, indices.getBufferLimit(), type, 0);
            } else {
                if (gl.isGL2GL3()) {
                    gl.getGL2GL3().glDrawElementsInstanced(glIndexMode, indices.getBufferLimit(), type,
                            indices.getBuffer(), primcount);
                }
View Full Code Here

Examples of javax.media.opengl.GL.glDrawElements()

                final int glIndexMode = getGLIndexMode(indexModes[indexModeCounter]);

                final int type = getGLDataType(indices);
                final int byteSize = indices.getByteCount();
                // offset in this call is done in bytes.
                gl.glDrawElements(glIndexMode, count, type, offset * byteSize);

                if (primcount < 0) {
                    gl.glDrawElements(glIndexMode, count, type, offset * byteSize);
                } else {
                    final int previousPos = indices.getBuffer().position();
View Full Code Here

Examples of javax.media.opengl.GL.glDrawElements()

                final int byteSize = indices.getByteCount();
                // offset in this call is done in bytes.
                gl.glDrawElements(glIndexMode, count, type, offset * byteSize);

                if (primcount < 0) {
                    gl.glDrawElements(glIndexMode, count, type, offset * byteSize);
                } else {
                    final int previousPos = indices.getBuffer().position();
                    indices.getBuffer().position(offset * byteSize);
                    if (gl.isGL2GL3()) {
                        gl.getGL2GL3()
View Full Code Here

Examples of javax.media.opengl.GL.glDrawElements()

            final int glIndexMode = getGLIndexMode(indexModes[0]);

            indices.position(0);

            if (primcount < 0) {
                gl.glDrawElements(glIndexMode, indices.getBufferLimit(), type, indices.getBuffer());
            } else {
                if (gl.isGL2GL3()) {
                    gl.getGL2GL3().glDrawElementsInstanced(glIndexMode, indices.getBufferLimit(), type,
                            indices.getBuffer(), primcount);
                }
View Full Code Here

Examples of javax.media.opengl.GL.glDrawElements()

                indices.getBuffer().position(offset);
                indices.getBuffer().limit(offset + count);

                if (primcount < 0) {
                    gl.glDrawElements(glIndexMode, count, type, indices.getBuffer());
                } else {
                    if (gl.isGL2GL3()) {
                        gl.getGL2GL3()
                                .glDrawElementsInstanced(glIndexMode, count, type, indices.getBuffer(), primcount);
                    }
View Full Code Here

Examples of javax.media.opengl.GL.glDrawElements()

       
      //DRAW //FIXME why does this not work?
      if (indexBuff == null){
        gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0, vertBuff.capacity()/3);
      }else{
        gl.glDrawElements(GL.GL_TRIANGLE_FAN, indexBuff.capacity(), GL.GL_UNSIGNED_INT, indexBuff);
      }
     
//        gl.glBegin (GL.GL_TRIANGLE_FAN);
//        for (int i = 0; i < vertexArr.length; i++) {
//        Vertex vertex = vertexArr[i];
View Full Code Here

Examples of javax.media.opengl.GL.glDrawElements()

        gl.glBindTexture(textureTarget, usedTextureID);
      }
     
      //DRAW with drawElements if geometry is indexed, else draw with drawArrays!
      if (geometryInfo.isIndexed()){
        gl.glDrawElements(fillDrawMode, indexBuff.capacity(), GL.GL_UNSIGNED_INT, indexBuff); //limit() oder capacity()??
      }else{
        gl.glDrawArrays(fillDrawMode, 0, vertBuff.capacity()/3);
      }
     
      if (textureDrawn){
View Full Code Here

Examples of javax.media.opengl.GL.glDrawElements()

      if (strokeWeight > 0)
        gl.glLineWidth(strokeWeight);
     
      //DRAW
      if (geometryInfo.isIndexed()){
        gl.glDrawElements(GL.GL_LINE_STRIP, indexBuff.capacity(), GL.GL_UNSIGNED_INT, indexBuff); ////indices.limit()?
      }else{
        gl.glDrawArrays(GL.GL_LINE_STRIP, 0, vertBuff.capacity()/3);
      }
     
//      if (drawSmooth)
View Full Code Here

Examples of javax.media.opengl.GL.glDrawElements()

      }
     
      if (indexBuff == null){
        gl.glDrawArrays(GL.GL_LINE_STRIP, 0, vertBuff.capacity()/3);
      }else{
        gl.glDrawElements(GL.GL_LINE_STRIP, indexBuff.capacity(), GL.GL_UNSIGNED_INT, indexBuff); ////indices.limit()?
      }
     
      //RESET LINE STIPPLE
      if (lineStipple != 0)
        gl.glDisable(GL.GL_LINE_STIPPLE);
View Full Code Here

Examples of javax.media.opengl.GL2.glDrawElements()

            int offset = initialIndexIndex;
            IntBuffer indicesBuffer = IntBuffer.wrap(indexCoord);
            for (int i = 0; i < strip_len; i++) {
                indicesBuffer.position(offset);
                int count = sarray[i];
                gl.glDrawElements(primType, count, GL.GL_UNSIGNED_INT, indicesBuffer);
                offset += count;
            }
        } else if ((geo_type == GeometryRetained.GEO_TYPE_INDEXED_QUAD_SET) ||
                (geo_type == GeometryRetained.GEO_TYPE_INDEXED_TRI_SET) ||
                (geo_type == GeometryRetained.GEO_TYPE_INDEXED_POINT_SET) ||
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.