Java 8 IntBuffer - 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 IntBuffer class.

This code example shows how to use the following methods: position
	//    offset - the offset in the vertex/index buffer to start at 
	//    numVertices - the number of vertices (indices) to draw 
	// R: [none] 
	public void drawFull(int primitiveType, int offset, int numVertices) {
		gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); // Enable Position in Vertices
		vertices.position(0);                        // Set Vertex Buffer to Position
		gl.glVertexPointer(positionCnt, GL10.GL_FLOAT, vertexSize, vertices);  // Set Vertex Pointer
 
		if (hasColor) {                            // IF Vertices Have Color
			gl.glEnableClientState(GL10.GL_COLOR_ARRAY);  // Enable Color in Vertices
			vertices.position(positionCnt);            // Set Vertex Buffer to Color
			gl.glColorPointer(COLOR_CNT, GL10.GL_FLOAT, vertexSize, vertices);  // Set Color Pointer
		} 
 
		if (hasTexCoords) {                        // IF Vertices Have Texture Coords
			gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);  // Enable Texture Coords in Vertices
			vertices.position(positionCnt + (hasColor ? COLOR_CNT : 0));  // Set Vertex Buffer to Texture Coords (NOTE: position based on whether color is also specified)
			gl.glTexCoordPointer(TEXCOORD_CNT, GL10.GL_FLOAT, vertexSize, vertices);  // Set Texture Coords Pointer
		} 
 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: capacity, limit, position, get
	protected static TextureData createTextureData (FileHandle file, boolean useMipMaps) {
		return createTextureData(file, null, useMipMaps);
	} 
 
	protected static int createGLHandle () { 
		buffer.position(0);
		buffer.limit(buffer.capacity());
		Gdx.gl.glGenTextures(1, buffer);
		return buffer.get(0);
	} 
	 
	protected static void uploadImageData (int target, TextureData data) {
		uploadImageData(target, data, 0);
	} 
	 
	public static void uploadImageData (int target, TextureData data, int miplevel) {
		if (data == null) {
			// FIXME: remove texture on target? 
			return; 
		} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: get, put
        byteBuffer.order(ByteOrder.nativeOrder());
        IntBuffer intBuffer = byteBuffer.asIntBuffer();
 
        int[] source = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
 
        intBuffer.put(source, 2, 2);
        intBuffer.put(source, 4, 2);
        assertEquals(4, intBuffer.get(0));
        assertEquals(5, intBuffer.get(1));
        assertEquals(6, intBuffer.get(2));
        assertEquals(7, intBuffer.get(3));
    } 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: position, put
This code example shows how to use the following methods: put
		putEvent(event);
	} 
 
    public synchronized void poll(IntBuffer coord_buffer, ByteBuffer buttons_buffer) {
        if (grabbed) {
            coord_buffer.put(0, (int)accum_dx);
            coord_buffer.put(1, (int)accum_dy);
        } else { 
            coord_buffer.put(0, (int)last_x);
            coord_buffer.put(1, (int)last_y);
        } 
        coord_buffer.put(2, accum_dz);
        accum_dx = accum_dy = accum_dz = 0;
        int old_position = buttons_buffer.position();
        buttons_buffer.put(buttons, 0, buttons.length);
        buttons_buffer.position(old_position);
    } 
     
	private void setCursorPos(float x, float y, long nanos) {
		if ( grabbed )
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 IntBuffer Questions & Answers:

See Code Examples for Java 8 IntBuffer Methods: