/** * @param mode * @param first * @param count * @see com.jogamp.opengl.GL#glDrawArrays(int, int, int) */ public void glDrawArrays(int mode, int first, int count) { try{delegate.glDrawArrays(mode, first, count);} catch(GLException e){glException(e); throw e;} } /**
@Override public void renderNonIndexed(int glVertexArray, int mode, int numVertices) { gl.glBindVertexArray(glVertexArray); gl.glDrawArrays(mode, 0, numVertices); }
@Override public void display(GLAutoDrawable glAutoDrawable) { GL3 gl = glAutoDrawable.getGL().getGL3(); gl.glClear(GL3.GL_DEPTH_BUFFER_BIT | GL3.GL_COLOR_BUFFER_BIT); gl.glUseProgram(program) gl.glBindVertexArray(vertexArray.get(0)); gl.glDrawArrays(GL.GL_TRIANGLES, 0, 6) }
public void process(GL3 gl, int renderListLogicalVec4Offset, int numPrimitives){ final int relevantVertexBufferWidth = ((int)(VERTEX_BUFFER_WIDTH/3))*3; vertexProgram.use(); vertexFrameBuffer.bindToDraw(); vertexProgram.getUniform("logicalVec4Offset").setui(renderListLogicalVec4Offset); gpu.memoryManager.get().bindToUniform(0, vertexProgram, vertexProgram.getUniform("rootBuffer")); objectProcessingStage.getCamMatrixTexture() .bindToTextureUnit(1, gl); objectProcessingStage.getNoCamMatrixTexture().bindToTextureUnit(2, gl); gl.glDepthMask(false); gl.glDisable(GL3.GL_BLEND); gl.glDisable(GL3.GL_DEPTH_TEST); gl.glDisable(GL3.GL_CULL_FACE); gl.glDisable(GL3.GL_MULTISAMPLE); gl.glViewport(0, 0, relevantVertexBufferWidth, (int)Math.ceil((double)(numPrimitives*3)/(double)relevantVertexBufferWidth));//256*256 = 65536, max we can handle. gl.glDrawArrays(GL3.GL_TRIANGLES, 0, 3); //Cleanup gpu.defaultFrameBuffers(); gpu.defaultProgram(); gpu.defaultTIU(); gpu.defaultTexture(); }
int numRows = (int)Math.ceil(remainingBlocks/(double)blocksPerRow); for(int i=0; i<numRows; i++){ gl.glDrawArrays(GL3.GL_LINE_STRIP, i*(blocksPerRow+1), (remainingBlocks<=blocksPerRow?remainingBlocks:blocksPerRow)+1); remainingBlocks -= blocksPerRow;
@Override public void apply(GL3 gl, double bufferStartTimeSeconds) { SamplePlaybackEvent.Factory origin = (SamplePlaybackEvent.Factory)getOrigin(); final float factoryVolume = (float)origin.getVolume(); if( factoryVolume < getLowVolumeThreshold() ) return; origin.getPanU().set((float)getPan()[0]*factoryVolume, (float)getPan()[1]*factoryVolume); final SoundSystem ss = Features.get(getOrigin().getTR(),SoundSystemFeature.class); final double bufferSizeSeconds = ss.getBufferSizeSeconds(), startTimeInBuffers=((getStartRealtimeSeconds()-bufferStartTimeSeconds)/(double)bufferSizeSeconds)*2-1, lengthPerRow = getSoundTexture().getLengthPerRowSeconds(); final int lengthInSegments = (int)(getSoundTexture().getNumRows()) * 2; //Times two because of the turn //origin.getNumRowsU().set((float)getSoundTexture().getNumRows());//XXX Kludge to get around int limitations in ES 2 origin.getNumRowsU().setui(getSoundTexture().getNumRows()); origin.getStartU().set((float)startTimeInBuffers); origin.getLengthPerRowU() .set((float)((2/playbackRatio)*(lengthPerRow/bufferSizeSeconds))); getSoundTexture().getGLTexture().bindToTextureUnit(0, gl); gl.glDrawArrays(GL3.GL_LINE_STRIP, 0, lengthInSegments+1); }//end apply(...)
gl.glDrawArrays(GL3.GL_POINTS, 0, (numTransparentBlocks+numOpaqueBlocks+numOpaqueUnoccludedTBlocks+numTransUnoccludedTBlocks)*primsPerBlock); }}); gl.glDrawArrays(GL3.GL_TRIANGLES, 0, numOpaqueVertices); gl.glDepthRange(0, 1); gl.glDepthFunc(GL3.GL_LEQUAL); gl.glDrawArrays(GL3.GL_TRIANGLES, numOpaqueVertices, numOpaqueUnoccludedVertices); vps.getVertexNormZTexture().bindToTextureUnit(8, gl); gl.glDrawArrays(GL3.GL_TRIANGLES, numOpaqueVertices+numOpaqueUnoccludedVertices, numTransparentVertices); gl.glDrawArrays(GL3.GL_TRIANGLES, numOpaqueVertices+numOpaqueUnoccludedVertices+numTransparentVertices, numTransUnoccludedVertices); .set4x4Matrix(getCamRotationProjectionMatrix(), true); gl.glDrawArrays(GL3.GL_TRIANGLES, 0, 36);