@AssistedInject public BufferObject(GraphicContext gcont, @Assisted Target target) { gc = gcont; this.target = target; int[] ids = new int[1]; gc.getGL().glGenBuffers(1, ids, 0); id = ids[0]; System.out.println("Generate Buffer with ID: " + id); }
private static int makeVBOId() { final GL gl = GLContext.getCurrentGL(); final IntBuffer idBuff = BufferUtils.createIntBuffer(1); gl.glGenBuffers(1, idBuff); return idBuff.get(0); }
@Override protected void init_vbo(final GL gl) { super.init_vbo(gl); if(vboEnabled && vboName==0) { final int[] tmp = new int[1]; gl.glGenBuffers(1, tmp, 0); vboName = tmp[0]; if(0 < interleavedOffset) { glArrayHandler.setSubArrayVBOName(vboName); } } }
context.glGenBuffers( 3, bufferID, 0 );
if(0 == vboName) { final int[] tmp = new int[1]; gl.glGenBuffers(1, tmp, 0); vboName = tmp[0];
public static DncDeviceLabelAtlas xferLabelAtlasToDevice( DncHostLabelAtlas hAtlas, GL gl ) { TexturableImage textureImage = hAtlas.textureImage; int textureHandle = genTexture( gl ); gl.glBindTexture( GL_TEXTURE_2D, textureHandle ); gl.glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); gl.glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); gl.glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); gl.glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); textureImage.pushToTexture( gl, GL_TEXTURE_2D ); int[] bufferHandles = new int[ 2 ]; gl.glGenBuffers( 2, bufferHandles, 0 ); int entriesAlignHandle = bufferHandles[ 0 ]; gl.glBindBuffer( GL_ARRAY_BUFFER, entriesAlignHandle ); gl.glBufferData( GL_ARRAY_BUFFER, hAtlas.entriesAlignBuf.remaining( ) * SIZEOF_FLOAT, hAtlas.entriesAlignBuf, GL_STATIC_DRAW ); int entriesBoundsHandle = bufferHandles[ 1 ]; gl.glBindBuffer( GL_ARRAY_BUFFER, entriesBoundsHandle ); gl.glBufferData( GL_ARRAY_BUFFER, hAtlas.entriesBoundsBuf.remaining( ) * SIZEOF_FLOAT, hAtlas.entriesBoundsBuf, GL_STATIC_DRAW ); return new DncDeviceLabelAtlas( hAtlas.chunkKey, textureImage.getWidth( ), textureImage.getHeight( ), entriesAlignHandle, entriesBoundsHandle, textureHandle ); }