added loadGLModel method in PApplet

This commit is contained in:
codeanticode
2010-02-03 15:36:34 +00:00
parent 81a922d899
commit 0d19175cd8
4 changed files with 26 additions and 0 deletions
@@ -11,6 +11,8 @@ import javax.microedition.khronos.opengles.*;
* This class holds a 3D model composed of vertices, normals, colors (per vertex) and
* texture coordinates (also per vertex). All this data is stored in Vertex Buffer Objects
* (VBO) in GPU memory for very fast access.
* By Andres Colubri
*
*/
@SuppressWarnings("unused")
public class GLModel implements GLConstants, PConstants {
@@ -68,6 +70,12 @@ public class GLModel implements GLConstants, PConstants {
}
// TODO: implement loading from obj and mdl files.
public GLModel(PApplet parent, String filename) { // Ignore
}
public GLModel(PApplet parent, int numVert, Parameters params) {
this.parent = parent;
a3d = (PGraphicsAndroid3D)parent.g;
@@ -12,6 +12,8 @@ import java.nio.*;
/**
* This class adds an opengl texture to a PImage object.
* By Andres Colubri
*
*/
@SuppressWarnings("unused")
public class GLTexture extends PImage implements PConstants, GLConstants {
@@ -3003,6 +3003,7 @@ public class PApplet extends Activity implements PConstants, Runnable {
// GL-methods
public GLFont loadGLFont(String filename) {
try {
InputStream input = createInput(filename);
@@ -3016,14 +3017,17 @@ public class PApplet extends Activity implements PConstants, Runnable {
return null;
}
public GLFont createGLFont(String name, float size) {
return createGLFont(name, size, true, GLFont.DEFAULT_CHARSET);
}
public GLFont createGLFont(String name, float size, boolean smooth) {
return createGLFont(name, size, smooth, GLFont.DEFAULT_CHARSET);
}
public GLFont createGLFont(String name, float size,
boolean smooth, char charset[]) {
String lowerName = name.toLowerCase();
@@ -3039,10 +3043,17 @@ public class PApplet extends Activity implements PConstants, Runnable {
return new GLFont(this, baseFont, round(size), smooth, charset);
}
public GLTexture loadGLTexture(String filename) {
return new GLTexture(this, filename);
}
public GLModel loadGLModel(String filename) {
return new GLModel(this, filename);
}
//////////////////////////////////////////////////////////////
// FILE/FOLDER SELECTION
@@ -25,6 +25,11 @@ import javax.microedition.khronos.egl.EGLDisplay;
// mipmaps are disabled
/*
* Android 3D renderer implemented with pure OpenGL ES 1.0/1.1
* By Andres Colubri
*
*/
public class PGraphicsAndroid3D extends PGraphics {
public SurfaceHolder holder;