Java 8 GL11 - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 GL11 class.

This code example shows how to use the following methods: glClientActiveTexture, glBindBuffer, glTexCoordPointer, glVertexPointer
This code example shows how to use the following methods: glBindBuffer, glDrawElements, glTexCoordPointer, glVertexPointer
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: glBindBuffer, glBufferData, glGenBuffers
 
        public void createBufferObjects(GL gl) {
            // Generate a the vertex and element buffer IDs 
            int[] vboIds = new int[2];
            GL11 gl11 = (GL11) gl;
            gl11.glGenBuffers(2, vboIds, 0);
            mVertexBufferObjectId = vboIds[0];
            mElementBufferObjectId = vboIds[1];
 
            // Upload the vertex data 
            gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertexBufferObjectId);
            mVertexByteBuffer.position(0);
            gl11.glBufferData(GL11.GL_ARRAY_BUFFER, mVertexByteBuffer.capacity(), mVertexByteBuffer, GL11.GL_STATIC_DRAW);
 
            gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mElementBufferObjectId);
            mIndexBuffer.position(0);
            gl11.glBufferData(GL11.GL_ELEMENT_ARRAY_BUFFER, mIndexBuffer.capacity() * CHAR_SIZE, mIndexBuffer, GL11.GL_STATIC_DRAW);
 
            // We don't need the in-memory data any more 
            mVertexBuffer = null;

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: glDrawArrays, glBindBuffer, glColorPointer, glDrawElements, glVertexPointer
		} 
	} 
 
	public void draw(GL11 gl) {
		if (useVBO) {
			gl.glBindBuffer(GL11.GL_ARRAY_BUFFER, vertexVbo);
			gl.glVertexPointer(3, GL10.GL_FLOAT, 0, 0);
 
			gl.glBindBuffer(GL11.GL_ARRAY_BUFFER, colorVbo);
			gl.glColorPointer(4, GL10.GL_UNSIGNED_BYTE, 0, 0);
 
			gl.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
			// gl.glDrawArrays(GL10.GL_LINE_STRIP, 0, N*N); 
 
			gl.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, vertexElementVbo);
			gl.glDrawElements(GL10.GL_LINE_STRIP, n * n, GL10.GL_UNSIGNED_SHORT, 0);
			gl.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, 0);
		} else { 
			gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuf);
			gl.glColorPointer(4, GL10.GL_UNSIGNED_BYTE, 0, colorBuf);

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: glBindTexture, glGenTextures, glTexParameterf, glTexParameteri, glTexParameteriv
            // change clip rect. 
            if (textureWidth != newTextureWidth || textureHeight != newTextureHeight || mTextureId == 0) {
                // Allocate a texture if needed. 
                if (textureId == 0) {
                    int[] textureIdOut = new int[1];
                    gl.glGenTextures(1, textureIdOut, 0);
                    textureId = textureIdOut[0];
                    mNeedsResize = false;
                    mTextureId = textureId;
 
                    // Set texture parameters. 
                    gl.glBindTexture(GL11.GL_TEXTURE_2D, textureId);
                    gl.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP_TO_EDGE);
                    gl.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP_TO_EDGE);
                    gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
                    gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
                } 
 
                // Set the new texture width and height. 
                textureWidth = newTextureWidth;

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: glClientActiveTexture, glBindBuffer, glTexCoordPointer, glVertexPointer
This code example shows how to use the following methods: glBindBuffer, glDrawElements, glTexCoordPointer, glVertexPointer
This code example shows how to use the following methods: glBindBuffer, glDrawElements, glNormalPointer, glVertexPointer
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: glBindBuffer, glBufferData, glGenBuffers
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: glBindBuffer, glDrawElements, glVertexPointer

Related Java 8 GL11 Questions & Answers:

See Code Examples for Java 8 GL11 Methods: