本文整理汇总了Java中java.nio.IntBuffer.remaining方法的典型用法代码示例。如果您正苦于以下问题:Java IntBuffer.remaining方法的具体用法?Java IntBuffer.remaining怎么用?Java IntBuffer.remaining使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.nio.IntBuffer
的用法示例。
在下文中一共展示了IntBuffer.remaining方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: glDeleteFramebuffers
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glDeleteFramebuffers(IntBuffer framebuffers) {
org.lwjgl.opengl.ARBFramebufferObject.glDeleteFramebuffers(framebuffers);
if (Properties.VALIDATE.enabled) {
Context context = CURRENT_CONTEXT.get();
int pos = framebuffers.position();
for (int i = 0; i < framebuffers.remaining(); i++) {
int framebuffer = framebuffers.get(pos + i);
if (framebuffer == 0)
continue;
FBO fbo = context.fbos.get(framebuffer);
if (fbo != null && fbo == context.currentFbo) {
context.currentFbo = context.defaultFbo;
}
context.fbos.remove(framebuffer);
}
}
}
示例2: glDeleteBuffersARB
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glDeleteBuffersARB(IntBuffer buffers) {
org.lwjgl.opengl.ARBVertexBufferObject.glDeleteBuffersARB(buffers);
if (Properties.PROFILE.enabled) {
Context ctx = CURRENT_CONTEXT.get();
int pos = buffers.position();
for (int i = 0; i < buffers.remaining(); i++) {
int buffer = buffers.get(pos + i);
BufferObject bo = ctx.bufferObjects.remove(buffer);
Iterator<Map.Entry<Integer, BufferObject>> it = ctx.bufferObjectBindings.entrySet().iterator();
while (it.hasNext()) {
if (it.next().getValue() == bo) {
it.remove();
}
}
}
}
}
示例3: glDeleteFramebuffersEXT
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glDeleteFramebuffersEXT(IntBuffer framebuffers) {
org.lwjgl.opengl.EXTFramebufferObject.glDeleteFramebuffersEXT(framebuffers);
if (Properties.VALIDATE.enabled) {
Context context = CURRENT_CONTEXT.get();
int pos = framebuffers.position();
for (int i = 0; i < framebuffers.remaining(); i++) {
int framebuffer = framebuffers.get(pos + i);
if (framebuffer == 0)
continue;
FBO fbo = context.fbos.get(framebuffer);
if (fbo != null && fbo == context.currentFbo) {
context.currentFbo = context.defaultFbo;
}
context.fbos.remove(framebuffer);
}
}
}
示例4: glBufferStorage
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glBufferStorage(int target, IntBuffer data, int flags) {
org.lwjgl.opengl.GL44.glBufferStorage(target, data, flags);
if (Properties.PROFILE.enabled) {
Context ctx = CURRENT_CONTEXT.get();
BufferObject bo = ctx.bufferObjectBindings.get(target);
if (bo != null) {
bo.size = data != null ? data.remaining() << 2 : 0L;
}
}
}
示例5: byteArrayToIntArray
import java.nio.IntBuffer; //导入方法依赖的package包/类
private int[] byteArrayToIntArray(byte[] byteArray) {
IntBuffer intBuf =
ByteBuffer.wrap(byteArray)
.order(ByteOrder.LITTLE_ENDIAN)
.asIntBuffer();
int[] array = new int[intBuf.remaining()];
intBuf.get(array);
return array;
}
示例6: processIndices
import java.nio.IntBuffer; //导入方法依赖的package包/类
/**
* Proceses the indices of a mesh.
*
* @param aiMesh - AIMesh to process indices for.
* @param indices - List of indices to add processed indices to.
*/
private static void processIndices(AIMesh aiMesh, List<Integer> indices) {
int numFaces = aiMesh.mNumFaces();
AIFace.Buffer aiFaces = aiMesh.mFaces();
for (int i = 0; i < numFaces; i++) {
AIFace aiFace = aiFaces.get();
IntBuffer buffer = aiFace.mIndices();
while (buffer.remaining() > 0) {
indices.add(buffer.get());
}
}
}
示例7: deleteVertexArrays
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void deleteVertexArrays(IntBuffer indices) {
Context context = CURRENT_CONTEXT.get();
int pos = indices.position();
for (int i = 0; i < indices.remaining(); i++) {
int index = indices.get(pos + i);
if (index == 0)
continue;
VAO vao = context.vaos.get(index);
if (vao != null && vao == context.currentVao) {
context.currentVao = context.defaultVao;
}
context.vaos.remove(index);
}
}
示例8: glBufferData
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glBufferData(int target, IntBuffer data, int usage) {
org.lwjgl.opengl.GL15.glBufferData(target, data, usage);
if (Properties.PROFILE.enabled) {
Context ctx = CURRENT_CONTEXT.get();
BufferObject bo = ctx.bufferObjectBindings.get(target);
if (bo != null) {
bo.size = data != null ? data.remaining() << 2 : 0L;
}
}
}
示例9: glGenTextures
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glGenTextures(IntBuffer textures) {
org.lwjgl.opengl.GL11.glGenTextures(textures);
Context ctx = CURRENT_CONTEXT.get();
int pos = textures.position();
for (int i = 0; i < textures.remaining(); i++) {
int texture = textures.get(pos + i);
ctx.textureObjects.put(texture, new TextureObject());
}
}
示例10: glGenProgramPipelines
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glGenProgramPipelines(IntBuffer pipelines) {
org.lwjgl.opengl.GL41.glGenProgramPipelines(pipelines);
if (Properties.VALIDATE.enabled) {
int position = pipelines.position();
Context context = CURRENT_CONTEXT.get();
for (int i = 0; i < pipelines.remaining(); i++) {
ProgramPipeline pp = new ProgramPipeline();
context.programPipelines.put(pipelines.get(position + i), pp);
}
}
}
示例11: glGenProgramPipelines
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glGenProgramPipelines(IntBuffer pipelines) {
org.lwjgl.opengl.ARBSeparateShaderObjects.glGenProgramPipelines(pipelines);
if (Properties.VALIDATE.enabled) {
int position = pipelines.position();
Context context = CURRENT_CONTEXT.get();
for (int i = 0; i < pipelines.remaining(); i++) {
ProgramPipeline pp = new ProgramPipeline();
context.programPipelines.put(pipelines.get(position + i), pp);
}
}
}
示例12: glGenVertexArrays
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glGenVertexArrays(IntBuffer arrays) {
org.lwjgl.opengl.GL30.glGenVertexArrays(arrays);
if (Properties.VALIDATE.enabled) {
Context context = CURRENT_CONTEXT.get();
int position = arrays.position();
for (int i = 0; i < arrays.remaining(); i++) {
VAO vao = new VAO(context.GL_MAX_VERTEX_ATTRIBS);
context.vaos.put(arrays.get(position + i), vao);
}
}
}
示例13: glGenFramebuffers
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glGenFramebuffers(IntBuffer framebuffers) {
org.lwjgl.opengl.GL30.glGenFramebuffers(framebuffers);
if (Properties.VALIDATE.enabled) {
Context ctx = CURRENT_CONTEXT.get();
int pos = framebuffers.position();
for (int i = 0; i < framebuffers.remaining(); i++) {
int handle = framebuffers.get(pos + i);
FBO fbo = new FBO(handle);
ctx.fbos.put(handle, fbo);
}
}
}
示例14: glGenVertexArrays
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glGenVertexArrays(IntBuffer arrays) {
org.lwjgl.opengl.ARBVertexArrayObject.glGenVertexArrays(arrays);
if (Properties.VALIDATE.enabled) {
Context context = CURRENT_CONTEXT.get();
int position = arrays.position();
for (int i = 0; i < arrays.remaining(); i++) {
VAO vao = new VAO(context.GL_MAX_VERTEX_ATTRIBS);
context.vaos.put(arrays.get(position + i), vao);
}
}
}
示例15: ConvertToIntArray
import java.nio.IntBuffer; //导入方法依赖的package包/类
public static int[] ConvertToIntArray(byte[] input){
IntBuffer intBuf =
ByteBuffer.wrap(input)
.order(ByteOrder.BIG_ENDIAN)
.asIntBuffer();
int[] output = new int[intBuf.remaining()];
intBuf.get(output);
return output;
}