ByteBuffer bb = ByteBuffer.wrap(new byte[] {0, 0, 0, 1, 0, 0, 0, 4}); IntBuffer ib = bb.asIntBuffer(); int i0 = ib.get(0); int i1 = ib.get(1); System.out.println(i0); System.out.println(i1);
public String glGetActiveUniform (int program, int index, IntBuffer size, Buffer type) { // FIXME this is less than ideal of course... IntBuffer typeTmp = BufferUtils.createIntBuffer(2); String name = GL20.glGetActiveUniform(program, index, 256, typeTmp); size.put(typeTmp.get(0)); if (type instanceof IntBuffer) ((IntBuffer)type).put(typeTmp.get(1)); return name; }
switch (bufferType) { case INT: IntBuffer fromInt = fromView.asIntBuffer(); IntBuffer toInt = toView.asIntBuffer(); for (int i = 0; i < n; i++) { int put = fromInt.get(fromOffset + i * fromStride); toInt.put(toOffset + i * toStride, put);
@NativeType("void") public static int glGenSemaphoresEXT() { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { IntBuffer semaphores = stack.callocInt(1); nglGenSemaphoresEXT(1, memAddress(semaphores)); return semaphores.get(0); } finally { stack.setPointer(stackPointer); } }
@NativeType("bool") public static boolean VRChaperoneSetup_ExportLiveToBuffer(@Nullable @NativeType("char *") ByteBuffer pBuffer, @NativeType("uint32_t *") IntBuffer pnBufferLength) { if (CHECKS) { check(pnBufferLength, 1); checkSafe(pBuffer, pnBufferLength.get(pnBufferLength.position())); } return nVRChaperoneSetup_ExportLiveToBuffer(memAddressSafe(pBuffer), memAddress(pnBufferLength)); }
public String glGetProgramInfoLog (int program) { ByteBuffer buffer = ByteBuffer.allocateDirect(1024 * 10); buffer.order(ByteOrder.nativeOrder()); ByteBuffer tmp = ByteBuffer.allocateDirect(4); tmp.order(ByteOrder.nativeOrder()); IntBuffer intBuffer = tmp.asIntBuffer(); GL20.glGetProgramInfoLog(program, intBuffer, buffer); int numBytes = intBuffer.get(0); byte[] bytes = new byte[numBytes]; buffer.get(bytes); return new String(bytes); }
public String glGetActiveAttrib (int program, int index, IntBuffer size, Buffer type) { IntBuffer typeTmp = BufferUtils.createIntBuffer(2); String name = GL20.glGetActiveAttrib(program, index, 256, size, typeTmp); size.put(typeTmp.get(0)); if (type instanceof IntBuffer) ((IntBuffer)type).put(typeTmp.get(1)); return name; }
PinotDataBuffer buffer = _memoryManager.allocate(bbSize, _allocationContext); _pinotDataBuffers.add(buffer); IntBuffer iBuf = buffer.toDirectByteBuffer(0L, bbSize).asIntBuffer(); for (int i = 0; i < iBuf.capacity(); i++) { iBuf.put(i, NULL_VALUE_INDEX); boolean done = false; for (int i = offsetInBuf; i < offsetInBuf + NUM_COLUMNS; i++) { if (iBuf.get(i) == NULL_VALUE_INDEX) { iBuf.put(i, entry.getValue()); done = true; break;
/** Requests a number of effect slots. */ @NativeType("ALvoid") public static int alGenAuxiliaryEffectSlots() { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { IntBuffer effectSlots = stack.callocInt(1); nalGenAuxiliaryEffectSlots(1, memAddress(effectSlots)); return effectSlots.get(0); } finally { stack.setPointer(stackPointer); } }
public String glGetProgramInfoLog (int program) { ByteBuffer buffer = ByteBuffer.allocateDirect(1024 * 10); buffer.order(ByteOrder.nativeOrder()); ByteBuffer tmp = ByteBuffer.allocateDirect(4); tmp.order(ByteOrder.nativeOrder()); IntBuffer intBuffer = tmp.asIntBuffer(); GL20.glGetProgramInfoLog(program, intBuffer, buffer); int numBytes = intBuffer.get(0); byte[] bytes = new byte[numBytes]; buffer.get(bytes); return new String(bytes); }
public String glGetActiveUniform (int program, int index, IntBuffer size, Buffer type) { IntBuffer typeTmp = BufferUtils.createIntBuffer(2); String name = GL20.glGetActiveUniform(program, index, 256, size, typeTmp); size.put(typeTmp.get(0)); if (type instanceof IntBuffer) ((IntBuffer)type).put(typeTmp.get(1)); return name; }
defaultFramebufferHandleInitialized = true; if (Gdx.app.getType() == ApplicationType.iOS) { IntBuffer intbuf = ByteBuffer.allocateDirect(16 * Integer.SIZE / 8).order(ByteOrder.nativeOrder()).asIntBuffer(); gl.glGetIntegerv(GL20.GL_FRAMEBUFFER_BINDING, intbuf); defaultFramebufferHandle = intbuf.get(0); } else { defaultFramebufferHandle = 0; IntBuffer buffer = BufferUtils.newIntBuffer(colorTextureCounter); for (int i = 0; i < colorTextureCounter; i++) { buffer.put(GL30.GL_COLOR_ATTACHMENT0 + i);
@NativeType("void") public static int glGenProgramPipelinesEXT() { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { IntBuffer pipelines = stack.callocInt(1); nglGenProgramPipelinesEXT(1, memAddress(pipelines)); return pipelines.get(0); } finally { stack.setPointer(stackPointer); } }
@Override synchronized void fillCountsArrayFromBuffer(final ByteBuffer buffer, final int length) { buffer.asIntBuffer().get(counts, 0, length); } }
public String glGetActiveAttrib (int program, int index, IntBuffer size, Buffer type) { IntBuffer typeTmp = BufferUtils.createIntBuffer(2); String name = GL20.glGetActiveAttrib(program, index, 256, size, typeTmp); size.put(typeTmp.get(0)); if (type instanceof IntBuffer) ((IntBuffer)type).put(typeTmp.get(1)); return name; }
defaultFramebufferHandleInitialized = true; if (Gdx.app.getType() == ApplicationType.iOS) { IntBuffer intbuf = ByteBuffer.allocateDirect(16 * Integer.SIZE / 8).order(ByteOrder.nativeOrder()).asIntBuffer(); gl.glGetIntegerv(GL20.GL_FRAMEBUFFER_BINDING, intbuf); defaultFramebufferHandle = intbuf.get(0); } else { defaultFramebufferHandle = 0; IntBuffer buffer = BufferUtils.newIntBuffer(colorTextureCounter); for (int i = 0; i < colorTextureCounter; i++) { buffer.put(GL30.GL_COLOR_ATTACHMENT0 + i);
@NativeType("void") public static int glGetFirstPerfQueryIdINTEL() { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { IntBuffer queryId = stack.callocInt(1); nglGetFirstPerfQueryIdINTEL(memAddress(queryId)); return queryId.get(0); } finally { stack.setPointer(stackPointer); } }
public String glGetProgramInfoLog (int program) { ByteBuffer buffer = ByteBuffer.allocateDirect(1024 * 10); buffer.order(ByteOrder.nativeOrder()); ByteBuffer tmp = ByteBuffer.allocateDirect(4); tmp.order(ByteOrder.nativeOrder()); IntBuffer intBuffer = tmp.asIntBuffer(); GL20.glGetProgramInfoLog(program, intBuffer, buffer); int numBytes = intBuffer.get(0); byte[] bytes = new byte[numBytes]; buffer.get(bytes); return new String(bytes); }
public String glGetActiveUniform (int program, int index, IntBuffer size, Buffer type) { // FIXME this is less than ideal of course... IntBuffer typeTmp = BufferUtils.createIntBuffer(2); String name = GL20.glGetActiveUniform(program, index, 256, typeTmp); size.put(typeTmp.get(0)); if (type instanceof IntBuffer) ((IntBuffer)type).put(typeTmp.get(1)); return name; }
IntBuffer array = ByteBuffer.allocateDirect(200*1000*1000*4) .order(ByteOrder.nativeOrder()).asIntBuffer(); int a = array.get(n); array.put(n, a+1);