some formatting

This commit is contained in:
codeanticode
2011-07-06 02:01:56 +00:00
parent 31dc3a426d
commit 919e67ce16
4 changed files with 13 additions and 37 deletions
@@ -300,8 +300,7 @@ class PFontTexture implements PConstants {
if (currentTex != lastTex || resized) {
setTexture(lastTex);
}
//textures[currentTex].setTexels(offsetX, offsetY, w, h, rgba);
TextureInfo tinfo = new TextureInfo(currentTex, offsetX, offsetY, w, h, rgba);
offsetX += w;
@@ -287,14 +287,17 @@ public class PFramebuffer implements PConstants {
// Color buffer setters.
public void setColorBuffer(PTexture tex) {
setColorBuffers(new PTexture[] { tex }, 1);
}
public void setColorBuffers(PTexture[] textures) {
setColorBuffers(textures, textures.length);
}
public void setColorBuffers(PTexture[] textures, int n) {
if (screenFb) return;
@@ -327,6 +330,7 @@ public class PFramebuffer implements PConstants {
}
}
///////////////////////////////////////////////////////////
// Allocate/release framebuffer.
@@ -1294,15 +1294,18 @@ public class PGraphicsOpenGL extends PGraphics {
allocatePGLObjects();
}
public void backupGL() {
backupPGLObjects();
}
public void restoreGL() {
clearPGLFramebuffers();
restorePGLObjects();
}
protected void saveGLState() {
saveGLMatrices();
}
@@ -97,39 +97,7 @@ public class PTexture implements PConstants {
init(width, height, (Parameters)params);
}
/**
* Creates an instance of PTexture using image file filename as source.
* @param parent PApplet
* @param filename String
*/
/*
public PTexture(PApplet parent, String filename) {
this(parent, filename, new Parameters());
}
*/
/**
* Creates an instance of PTexture using image file filename as source and the specified texture parameters.
* @param parent PApplet
* @param filename String
* @param params Parameters
*/
/*
public PTexture(PApplet parent, String filename, Object params) {
this.parent = parent;
ogl = (PGraphicsOpenGL)parent.g;
ogl.registerGLObject(this);
glID = 0;
PImage img = parent.loadImage(filename);
setParameters((Parameters)params);
set(img);
}
*/
public void delete() {
release();
@@ -703,6 +671,7 @@ public class PTexture implements PConstants {
// Allocate/release texture.
protected void setSize(int w, int h) {
width = w;
height = h;
@@ -730,10 +699,9 @@ public class PTexture implements PConstants {
maxTexCoordV = (float)height / glHeight;
}
/**
* Allocates the opengl texture object.
* @param w int
* @param h int
* Allocates the opengl texture object.
*/
protected void allocate() {
release(); // Just in the case this object is being re-allocated.
@@ -762,6 +730,7 @@ public class PTexture implements PConstants {
getGl().glDisable(glTarget);
}
/**
* Deletes the opengl texture object.
*/
@@ -771,6 +740,7 @@ public class PTexture implements PConstants {
glID = 0;
}
}
///////////////////////////////////////////////////////////