Examples of glDrawArrays()


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

        if (indexLengths == null) {
            final int glIndexMode = getGLIndexMode(indexModes[0]);

            if (primcount < 0) {
                gl.glDrawArrays(glIndexMode, 0, vertexBuffer.getTupleCount());
            } else {
                if (gl.isGL2GL3()) {
                    gl.getGL2GL3().glDrawArraysInstanced(glIndexMode, 0, vertexBuffer.getTupleCount(), primcount);
                }
            }
View Full Code Here

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

                final int count = indexLengths[i];

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

                if (primcount < 0) {
                    gl.glDrawArrays(glIndexMode, offset, count);
                } else {
                    if (gl.isGL2GL3()) {
                        gl.getGL2GL3().glDrawArraysInstanced(glIndexMode, offset, count, primcount);
                    }
                }
View Full Code Here

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

      int.class, Float.SIZE / Byte.SIZE,
      int.class, GL.GL_FLOAT,
      boolean.class, false,
      int.class, 0,
      long.class, 0);
    gl.glDrawArrays(GL.GL_TRIANGLES, 0, 3);
    GLUtil.glInvoke(gl, "glDisableVertexAttribArray", int.class, 0);
    buffer.unbind();
    program.unbind();
  }
View Full Code Here

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

      int.class, Float.SIZE / Byte.SIZE,
      int.class, GL.GL_FLOAT,
      boolean.class, false,
      int.class, 0,
      long.class, 0);
    gl.glDrawArrays(GL.GL_TRIANGLES, 0, 3);
    GLUtil.glInvoke(gl, "glDisableVertexAttribArray", int.class, 0);
    buffer.unbind();
    program.unbind();
  }
View Full Code Here

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

      int.class, Float.SIZE / Byte.SIZE,
      int.class, GL.GL_FLOAT,
      boolean.class, false,
      int.class, 0,
      long.class, (Float.SIZE / Byte.SIZE) * 4 * 3);
    gl.glDrawArrays(GL.GL_TRIANGLES, 0, 3);
    GLUtil.glInvoke(gl, "glDisableVertexAttribArray", int.class, 0);
    GLUtil.glInvoke(gl, "glDisableVertexAttribArray", int.class, 1);
    buffer.unbind();
    program.unbind();
  }
View Full Code Here

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

        gl.glVertexPointer(2, GL.GL_FLOAT, 0, posArray);

        gl.glEnableClientState(GL.GL_COLOR_ARRAY);
        gl.glColorPointer(3, GL.GL_FLOAT, 0, colArray);

        gl.glDrawArrays(GL.GL_LINES, 0, maxParticles * 2);
      }
      else {
        gl.glBegin(GL.GL_LINES);               // start drawing points
        for(int i=0; i<maxParticles; i++) {
          if(particles[i].alpha > 0) {
View Full Code Here

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

       
        gl.glColor4d (colorBuff.get(0), colorBuff.get(1), colorBuff.get(2), colorBuff.get(3));
       
      //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);
View Full Code Here

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

     
      //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){
        gl.glBindTexture(textureTarget, 0);
        gl.glDisable(textureTarget);
View Full Code Here

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

     
      //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)
//        gl.glDisable(GL.GL_LINE_SMOOTH);
      //FIXME TEST
View Full Code Here

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

        gl.glLineStipple(1, lineStipple);
        gl.glEnable(GL.GL_LINE_STIPPLE);
      }
     
      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
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.