private static int getMaxTextureUnits () { IntBuffer buffer = BufferUtils.newIntBuffer(16); Gdx.gl.glGetIntegerv(GL20.GL_MAX_TEXTURE_IMAGE_UNITS, buffer); return buffer.get(0); }
private static int getMaxTextureUnits () { IntBuffer buffer = BufferUtils.newIntBuffer(16); Gdx.gl.glGetIntegerv(GL20.GL_MAX_TEXTURE_IMAGE_UNITS, buffer); return buffer.get(0); }
private void invalidateTexture (Texture texture) { IntBuffer buffer = BufferUtils.newIntBuffer(1); buffer.put(0, texture.getTextureObjectHandle()); Gdx.gl.glDeleteTextures(1, buffer); }
private int loadShader (int type, String source) { GL20 gl = Gdx.gl20; IntBuffer intbuf = BufferUtils.newIntBuffer(1); int shader = gl.glCreateShader(type); if (shader == 0) return -1; gl.glShaderSource(shader, source); gl.glCompileShader(shader); gl.glGetShaderiv(shader, GL20.GL_COMPILE_STATUS, intbuf); int compiled = intbuf.get(0); if (compiled == 0) { // gl.glGetShaderiv(shader, GL20.GL_INFO_LOG_LENGTH, intbuf); // int infoLogLength = intbuf.get(0); // if (infoLogLength > 1) { String infoLog = gl.glGetShaderInfoLog(shader); log += type == GL20.GL_VERTEX_SHADER ? "Vertex shader\n" : "Fragment shader:\n"; log += infoLog; // } return -1; } return shader; }
private int loadShader (int type, String source) { GL20 gl = Gdx.gl20; IntBuffer intbuf = BufferUtils.newIntBuffer(1); int shader = gl.glCreateShader(type); if (shader == 0) return -1; gl.glShaderSource(shader, source); gl.glCompileShader(shader); gl.glGetShaderiv(shader, GL20.GL_COMPILE_STATUS, intbuf); int compiled = intbuf.get(0); if (compiled == 0) { // gl.glGetShaderiv(shader, GL20.GL_INFO_LOG_LENGTH, intbuf); // int infoLogLength = intbuf.get(0); // if (infoLogLength > 1) { String infoLog = gl.glGetShaderInfoLog(shader); log += type == GL20.GL_VERTEX_SHADER ? "Vertex shader\n" : "Fragment shader:\n"; log += infoLog; // } return -1; } return shader; }
CharBuffer cb = BufferUtils.newCharBuffer(8); ShortBuffer sb = BufferUtils.newShortBuffer(8); IntBuffer ib = BufferUtils.newIntBuffer(8); LongBuffer lb = BufferUtils.newLongBuffer(8); FloatBuffer fb = BufferUtils.newFloatBuffer(8);
private void benchInt () { IntBuffer ib = BufferUtils.newIntBuffer(1024 * 1024 / 4); int[] ints = new int[1024 * 1024 / 4]; int len = ints.length;
@Override public void consumeCustomData (int target) { if (compressedData == null) throw new GdxRuntimeException("Call prepare() before calling consumeCompressedData()"); IntBuffer buffer = BufferUtils.newIntBuffer(16);
@Override public void consumeCustomData (int target) { if (compressedData == null) throw new GdxRuntimeException("Call prepare() before calling consumeCompressedData()"); IntBuffer buffer = BufferUtils.newIntBuffer(16);
IntBuffer buffer = BufferUtils.newIntBuffer(colorTextureCounter); for (int i = 0; i < colorTextureCounter; i++) { buffer.put(GL30.GL_COLOR_ATTACHMENT0 + i);
IntBuffer buffer = BufferUtils.newIntBuffer(colorTextureCounter); for (int i = 0; i < colorTextureCounter; i++) { buffer.put(GL30.GL_COLOR_ATTACHMENT0 + i);
@Nonnull @Override public IntBuffer createNativeOrderedIntBuffer(final int numInts) { return BufferUtils.newIntBuffer(numInts); } }
@Nonnull @Override public IntBuffer createNativeOrderedIntBuffer(final int numInts) { return BufferUtils.newIntBuffer(numInts); } }
private static int getMaxTextureUnits () { IntBuffer buffer = BufferUtils.newIntBuffer(16); Gdx.gl.glGetIntegerv(GL20.GL_MAX_TEXTURE_IMAGE_UNITS, buffer); return buffer.get(0); }
@Override public void glGetIntegerv(int pname, int[] params, int offset) { IntBuffer intBuffer = BufferUtils.newIntBuffer(17); intBuffer.put(params,offset,params.length); Gdx.gl.glGetIntegerv(pname, intBuffer); intBuffer.get(params); }
public void delete() { IntBuffer buf = BufferUtils.newIntBuffer(1); buf.put(id); Gdx.gl.glDeleteFramebuffers( 1, buf ); }
public Renderbuffer() { IntBuffer buf = BufferUtils.newIntBuffer(1); Gdx.gl.glGenRenderbuffers( 1, buf ); id = buf.get(); }
public Framebuffer() { IntBuffer buf = BufferUtils.newIntBuffer(1); Gdx.gl.glGenBuffers( 1, buf ); id = buf.get(); }
public void delete() { IntBuffer buf = BufferUtils.newIntBuffer(1); buf.put(id); Gdx.gl.glDeleteRenderbuffers( 1, buf ); }
public void link() { Gdx.gl.glLinkProgram( handle ); IntBuffer status = BufferUtils.newIntBuffer(1); Gdx.gl.glGetProgramiv( handle, GL20.GL_LINK_STATUS, status ); if (status.get() == GL20.GL_FALSE) { throw new Error( Gdx.gl.glGetProgramInfoLog( handle ) ); } }