GLModel API changes

This commit is contained in:
codeanticode
2010-01-26 11:57:30 +00:00
parent 5589c8b1c6
commit 7a0cd57f92
5 changed files with 939 additions and 315 deletions
@@ -62,7 +62,25 @@ public interface GLConstants {
* This constant identifies the linear/linear function to build mipmaps .
*/
public static final int LINEAR_MIPMAP_LINEAR = 5;
/**
* Static usage mode for GLModels (vertices won't be updated after creation).
*/
public static final int STATIC = 0;
/**
* Dynamic usage mode for GLModels (vertices will be updated after creation).
*/
public static final int DYNAMIC = 1;
public static final int VERTICES = 0;
public static final int NORMALS = 1;
public static final int COLORS = 2;
public static final int TEXTURES = 3;
public static final int GROUPS = 3;
public static final int GL_DEPTH_STENCIL = 0x84F9;
public static final int GL_UNSIGNED_INT_24_8 = 0x84FA;
public static final int GL_DEPTH24_STENCIL8 = 0x88F0;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,22 @@
package processing.android.core;
public class GLModelParameters implements GLConstants, PConstants {
GLModelParameters() {
updateMode = STATIC;
drawMode= POINTS;
pointSize = 1;
lineWidth = 1;
}
GLModelParameters(GLModelParameters src) {
updateMode = src.updateMode;
drawMode= src.drawMode;
pointSize = src.pointSize;
lineWidth = src.lineWidth;
}
public int updateMode;
public int drawMode;
public int pointSize;
public int lineWidth;
}
@@ -250,6 +250,12 @@ public class GLTexture extends PImage implements PConstants, GLConstants
init(width, height, params);
}
protected void finalize() {
if (tex[0] != 0) {
releaseTexture();
}
}
/**
* Sets the size of the image and texture to width x height. If the texture is already initialized,
* it first destroys the current opengl texture object and then creates a new one with the specified
@@ -3363,7 +3363,8 @@ public class PGraphicsAndroid3D extends PGraphics {
lightSpotAngle[lightCount] = angle;
lightSpotAngleCos[lightCount] = Math.max(0, (float) Math.cos(angle));
lightSpotConcentration[lightCount] = concentration;
glLightEnable(lightCount);
glLightNoAmbient(lightCount);
glLightPosition(lightCount);
glLightDirection(lightCount);