Updated PGL interface

This commit is contained in:
codeanticode
2012-01-22 02:04:09 +00:00
parent 50cebf56af
commit caf3efc107
4 changed files with 17 additions and 17 deletions
@@ -347,7 +347,7 @@ class PFontTexture implements PConstants {
void updateTex() {
textures[texIndex].bind();
textures[texIndex].setTexels(offsetX, crop[0] - 1, crop[1] + crop[3] - 1, crop[2] + 2, -crop[3] + 2, pixels);
textures[texIndex].setTexels(pixels, 0, crop[0] - 1, crop[1] + crop[3] - 1, crop[2] + 2, -crop[3] + 2);
textures[texIndex].unbind();
}
}
@@ -521,7 +521,7 @@ public class PFramebuffer implements PConstants {
protected void copyToTexture(IntBuffer buffer, int glid, int gltarget) {
pgl.enableTexturing(gltarget);
pgl.bindTexture(gltarget, glid);
pgl.copyTexSubImage(buffer, gltarget, 0, 0, width, height);
pgl.copyTexSubImage(buffer, gltarget, 0, 0, 0, width, height);
pgl.unbindTexture(gltarget);
pgl.disableTexturing(gltarget);
}
@@ -472,18 +472,18 @@ public class PGL {
public void initTex(int target, int format, int w, int h) {
gl.glTexImage2D(target, 0, format, w, h, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, null);
}
public void copyTexSubImage(Buffer image, int target, int x, int y, int w, int h) {
gl.glTexSubImage2D(target, 0, x, y, w, h, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, image);
}
public void copyTexSubPixels(int[] pixels, int target, int x, int y, int w, int h) {
gl.glTexSubImage2D(target, 0, x, y, w, h, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, IntBuffer.wrap(pixels));
public void copyTexImage(Buffer image, int target, int format, int level, int w, int h) {
gl.glTexImage2D(target, level, format, w, h, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, image);
}
public void copyTexImage(Buffer image, int target, int format, int w, int h) {
gl.glTexImage2D(target, 0, format, w, h, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, image);
public void copyTexSubImage(Buffer image, int target, int level, int x, int y, int w, int h) {
gl.glTexSubImage2D(target, level, x, y, w, h, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, image);
}
public void copyTexSubImage(int[] pixels, int target, int level, int x, int y, int w, int h) {
gl.glTexSubImage2D(target, level, x, y, w, h, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, IntBuffer.wrap(pixels));
}
public void setTexEnvironmentMode(int mode) {
gl2f.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, mode);