mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
bind/unbind methods in PTexture are public
This commit is contained in:
@@ -279,7 +279,7 @@ public class PTexture implements PConstants {
|
||||
gl.glBindTexture(glTarget, 0);
|
||||
gl.glDisable(glTarget);
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -412,14 +412,27 @@ public class PTexture implements PConstants {
|
||||
public void setFlippedY(boolean v) {
|
||||
flippedY = v;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
// Bind/unbind
|
||||
|
||||
public void bind() {
|
||||
gl.glEnable(glTarget);
|
||||
gl.glBindTexture(glTarget, glID);
|
||||
}
|
||||
|
||||
public void unbind() {
|
||||
gl.glEnable(glTarget);
|
||||
gl.glBindTexture(glTarget, 0);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
// Utilities
|
||||
|
||||
// bit shifting this might be more efficient
|
||||
private int nextPowerOfTwo(int val) {
|
||||
protected int nextPowerOfTwo(int val) {
|
||||
int ret = 1;
|
||||
while (ret < val) {
|
||||
ret <<= 1;
|
||||
@@ -768,16 +781,6 @@ public class PTexture implements PConstants {
|
||||
gl.glTexSubImage2D(glTarget, 0, x, y, w, h, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, IntBuffer.wrap(pix));
|
||||
}
|
||||
|
||||
protected void bind() {
|
||||
gl.glEnable(glTarget);
|
||||
gl.glBindTexture(glTarget, glID);
|
||||
}
|
||||
|
||||
protected void unbind() {
|
||||
gl.glEnable(glTarget);
|
||||
gl.glBindTexture(glTarget, 0);
|
||||
}
|
||||
|
||||
protected void copyObject(PTexture src) {
|
||||
// The OpenGL texture of this object is replaced with the one from the source object,
|
||||
// so we delete the former to avoid resource wasting.
|
||||
|
||||
Reference in New Issue
Block a user