当前位置: 首页>>代码示例>>Java>>正文


Java IntBuffer.position方法代码示例

本文整理汇总了Java中java.nio.IntBuffer.position方法的典型用法代码示例。如果您正苦于以下问题:Java IntBuffer.position方法的具体用法?Java IntBuffer.position怎么用?Java IntBuffer.position使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.nio.IntBuffer的用法示例。


在下文中一共展示了IntBuffer.position方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ensureLargeEnough

import java.nio.IntBuffer; //导入方法依赖的package包/类
public static IntBuffer ensureLargeEnough(IntBuffer buffer, int required) {
    if (buffer != null) {
        buffer.limit(buffer.capacity());
    }
    if (buffer == null || (buffer.remaining() < required)) {
        int position = (buffer != null ? buffer.position() : 0);
        IntBuffer newVerts = createIntBuffer(position + required);
        if (buffer != null) {
            buffer.flip();
            newVerts.put(buffer);
            newVerts.position(position);
        }
        buffer = newVerts;
    }
    return buffer;
}
 
开发者ID:asiermarzo,项目名称:Ultraino,代码行数:17,代码来源:BufferUtils.java

示例2: glShaderSource

import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glShaderSource(int shader, org.lwjgl.PointerBuffer strings, IntBuffer length) {
    org.lwjgl.opengl.GL20.glShaderSource(shader, strings, length);
    if (TRACE.enabled) {
        /* Log the shader source */
        StringBuilder sb = new StringBuilder();
        if (strings != null && length != null) {
            int stringsPos = strings.position();
            int lengthPos = length.position();
            for (int i = 0; i < strings.remaining(); i++) {
                int len = length.get(lengthPos + i);
                ByteBuffer string = org.lwjgl.system.MemoryUtil.memByteBuffer(strings.get(stringsPos + i), len);
                String source = org.lwjgl.system.MemoryUtil.memASCII(string, len);
                sb.append(source);
            }
        }
        trace("Shader source for shader [" + shader + "]:\n" + sb.toString());
    }
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:19,代码来源:GL20.java

示例3: glDeleteTextures

import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glDeleteTextures(IntBuffer textures) {
    org.lwjgl.opengl.GL11.glDeleteTextures(textures);
    if (Properties.PROFILE.enabled) {
        Context ctx = CURRENT_CONTEXT.get();
        int pos = textures.position();
        for (int i = 0; i < textures.remaining(); i++) {
            int buffer = textures.get(pos + i);
            TextureObject to = ctx.textureObjects.remove(buffer);
            Iterator<Map.Entry<Integer, TextureObject>> it = ctx.textureObjectBindings.entrySet().iterator();
            while (it.hasNext()) {
                if (it.next().getValue() == to) {
                    it.remove();
                }
            }
        }
    }
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:18,代码来源:GL11.java

示例4: glShaderSource

import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glShaderSource(int shader, org.lwjgl.PointerBuffer strings, IntBuffer length) {
    if (TRACE.enabled) {
        /* Log the shader source */
        StringBuilder sb = new StringBuilder();
        if (strings != null && length != null) {
            int stringsPos = strings.position();
            int lengthPos = length.position();
            for (int i = 0; i < strings.remaining(); i++) {
                int len = length.get(lengthPos + i);
                ByteBuffer string = org.lwjgl.system.MemoryUtil.memByteBuffer(strings.get(stringsPos + i), len);
                String source = org.lwjgl.system.MemoryUtil.memASCII(string, len);
                sb.append(source);
            }
        }
        trace("Shader source for shader [" + shader + "]:\n" + sb.toString());
    }
    org.lwjgl.opengl.ARBShaderObjects.glShaderSourceARB(shader, strings, length);
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:19,代码来源:ARBShaderObjects.java

示例5: getIndexIntBuffer

import java.nio.IntBuffer; //导入方法依赖的package包/类
@Override
public IntBuffer getIndexIntBuffer( final byte[] buffer , final int start , final int length ) throws IOException{
  int size = length / Byte.BYTES;
  ByteBuffer wrapBuffer = ByteBuffer.wrap( buffer , start , length );
  IntBuffer result = IntBuffer.allocate( size );
  for( int i = 0 ; i < size ; i++ ){
    result.put( (int)( wrapBuffer.get() ) );
  }
  result.position( 0 );
  return result;
}
 
开发者ID:yahoojapan,项目名称:multiple-dimension-spread,代码行数:12,代码来源:OptimizeLongColumnBinaryMaker.java

示例6: glLoadMatrixx

import java.nio.IntBuffer; //导入方法依赖的package包/类
public void glLoadMatrixx(IntBuffer m) {
	int position = m.position();
	mCurrent.glLoadMatrixx(m);
	m.position(position);
	mgl.glLoadMatrixx(m);
	if ( _check) check();
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:8,代码来源:MatrixTrackingGL.java

示例7: getIndexIntBuffer

import java.nio.IntBuffer; //导入方法依赖的package包/类
@Override
public IntBuffer getIndexIntBuffer( final int size , final ByteBuffer wrapBuffer ) throws IOException{
  IntBuffer result = IntBuffer.allocate( size );
  for( int i = 0 ; i < size ; i++ ){
    result.put( (int)( wrapBuffer.getShort() ) );
  }
  result.position( 0 );
  return result;
}
 
开发者ID:yahoojapan,项目名称:multiple-dimension-spread,代码行数:10,代码来源:OptimizeStringColumnBinaryMaker.java

示例8: glMultMatrixx

import java.nio.IntBuffer; //导入方法依赖的package包/类
public void glMultMatrixx(IntBuffer m) {
	int position = m.position();
	mCurrent.glMultMatrixx(m);
	m.position(position);
	mgl.glMultMatrixx(m);
	if ( _check) check();
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:8,代码来源:MatrixTrackingGL.java

示例9: 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);
        }
    }
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:12,代码来源:ARBVertexArrayObject.java

示例10: deleteTextures

import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void deleteTextures(IntBuffer p_deleteTextures_0_)
{
    p_deleteTextures_0_.rewind();

    while (p_deleteTextures_0_.position() < p_deleteTextures_0_.limit())
    {
        int i = p_deleteTextures_0_.get();
        deleteTexture(i);
    }

    p_deleteTextures_0_.rewind();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:GlStateManager.java

示例11: glGenFramebuffersEXT

import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glGenFramebuffersEXT(IntBuffer framebuffers) {
    org.lwjgl.opengl.EXTFramebufferObject.glGenFramebuffersEXT(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);
        }
    }
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:13,代码来源:EXTFramebufferObject.java

示例12: initBuf

import java.nio.IntBuffer; //导入方法依赖的package包/类
protected IntBuffer initBuf(int[] num, int buflen) {
	IntBuffer intBuf = IntBuffer.allocate(buflen);
	intBuf.position(buflen - num.length);
	for (int i = 0; i < buflen; i++)
		intBuf.put(i, 0);
	intBuf.put(num);
	intBuf.rewind();
	return intBuf;
}
 
开发者ID:Jim00000,项目名称:Big-Number-Calculation,代码行数:10,代码来源:Add.java

示例13: initBuffer

import java.nio.IntBuffer; //导入方法依赖的package包/类
@Override
public IntBuffer initBuffer(int width, int height) {
    int[] pixels = new int[width * height];
    IntBuffer intBuffer = IntBuffer.wrap(pixels);
    intBuffer.position(0);
    return intBuffer;
}
 
开发者ID:uestccokey,项目名称:EZFilter,代码行数:8,代码来源:BitmapOutput.java

示例14: glGenFramebuffers

import java.nio.IntBuffer; //导入方法依赖的package包/类
public static void glGenFramebuffers(IntBuffer framebuffers) {
    org.lwjgl.opengl.ARBFramebufferObject.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);
        }
    }
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:13,代码来源:ARBFramebufferObject.java

示例15: intBufferUtil

import java.nio.IntBuffer; //导入方法依赖的package包/类
private IntBuffer intBufferUtil(int[] arr) {
	// 初始化ByteBuffer,长度为arr数组的长度*4,因为一个int占4个字节
	ByteBuffer qbb = ByteBuffer.allocateDirect(arr.length * 4);
	// 数组排列用nativeOrder
	qbb.order(ByteOrder.nativeOrder());
	IntBuffer mBuffer = qbb.asIntBuffer();
	mBuffer.put(arr);
	mBuffer.position(0);
	return mBuffer;
}
 
开发者ID:FacePlusPlus,项目名称:MegviiFacepp-Android-SDK,代码行数:11,代码来源:CameraMatrix.java


注:本文中的java.nio.IntBuffer.position方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。