@Override public Object run(final GL gl, final Object args) { final int[] _args = (int[])args; gl.glDrawArrays(GL.GL_POINTS, _args[0], _args[1]); return null; } };
/** * @param context * @param eye */ public void renderPrepared( GL context, float[] eye ) { // the translation context.glTranslatef( location[0], location[1], location[2] ); // the rotation calculateAndSetRotation( context, eye ); context.glScalef( width, 1, height ); context.glDrawArrays( GL.GL_QUADS, 0, 4 ); }
if ( GL_QUADS == mode && !gl.isGL2() ) { for (int j = 0; j < vElems - 3; j += 4) { gl.glDrawArrays(GL.GL_TRIANGLE_FAN, j, 4); gl.glDrawArrays(mode, 0, vElems); final ByteBuffer b = (ByteBuffer) indices; for (int j = 0; j < idxLen; j++) { gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x000000ff & b.get(idx0+j), 4); gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x0000ffff & b.get(idx0+j), 4); gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0xffffffff & b.get(idx0+j), 4);
public void renderRange(int offset, int length) { attributs.bind(); if (asarray) { gc.getGL().glDrawArrays(primitivtype, offset, length); } else { gc.getGL().glDrawElements(primitivtype, length, indextype, offset * 4L); } attributs.disable(); }
public void renderPrepared( RenderContext glRenderContext, DirectGeometryBuffer geomBuffer ) { enableArrays( glRenderContext, geomBuffer ); GL context = glRenderContext.getContext(); normalBuffer.rewind(); context.glPushAttrib( GL.GL_CURRENT_BIT | GL.GL_LIGHTING_BIT ); // context.glMaterialfv( GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, ambientColor, 0 ); context.glMaterialfv( GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, diffuseColor, 0 ); context.glMaterialfv( GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, specularColor, 0 ); context.glMaterialfv( GL.GL_FRONT_AND_BACK, GL.GL_EMISSION, emmisiveColor, 0 ); context.glMaterialf( GL.GL_FRONT_AND_BACK, GL.GL_SHININESS, style.getShininess() ); context.glDrawArrays( openGLType, 0, vertexCount ); context.glPopAttrib(); disableArrays( glRenderContext ); }
gl.glDrawArrays(glIndexMode, 0, vertexBuffer.getTupleCount()); } else { if (gl.isGL2GL3()) { gl.glDrawArrays(glIndexMode, offset, count); } else { if (gl.isGL2GL3()) {
@Override public void render( RenderContext glRenderContext ) { Point3d eye = glRenderContext.getViewParams().getViewFrustum().getEyePos(); GL context = glRenderContext.getContext(); context.glPushMatrix(); context.glDepthMask( false ); context.glEnable( GL.GL_TEXTURE_2D ); context.glEnableClientState( GL.GL_TEXTURE_COORD_ARRAY ); // the translation context.glTranslatef( location[0], location[1], location[2] ); // the rotation calculateAndSetRotation( context, new float[] { (float) eye.x, (float) eye.y, (float) eye.z } ); context.glScalef( width, 1, height ); TexturePool.loadTexture( glRenderContext, textureID ); // context.glMaterialfv( GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE, new float[] { 1, 1, 1, .1f }, 0 ); context.glVertexPointer( 3, GL.GL_FLOAT, 0, coordBuffer ); context.glTexCoordPointer( 2, GL.GL_FLOAT, 0, textureBuffer ); // context.glDisableClientState( GL.GL_NORMAL_ARRAY ); context.glDrawArrays( GL.GL_QUADS, 0, 4 ); context.glDisableClientState( GL.GL_TEXTURE_COORD_ARRAY ); context.glDisable( GL.GL_TEXTURE_2D ); context.glDepthMask( true ); context.glMatrixMode( GL.GL_MODELVIEW ); context.glPopMatrix(); }