summaryrefslogtreecommitdiffstats
path: root/src/net/java/joglutils/lighting/Material.java
diff options
context:
space:
mode:
authoreteq <[email protected]>2006-12-21 20:13:34 +0000
committereteq <[email protected]>2006-12-21 20:13:34 +0000
commit63d9d453d16f23102b28ad586c520a6b8bf96337 (patch)
treeca53267549f890dd064ee7ee1e9ad3ab43ec023e /src/net/java/joglutils/lighting/Material.java
parent9f2fc9467a685aca37ed6ec6110408c137ceb925 (diff)
Initial implementation of javatext package. Normals not yet correct, and no texture implementation yet. Use FontDrawer main method for testing.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@26 83d24430-9974-4f80-8418-2cc3294053b9
Diffstat (limited to 'src/net/java/joglutils/lighting/Material.java')
-rw-r--r--src/net/java/joglutils/lighting/Material.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/net/java/joglutils/lighting/Material.java b/src/net/java/joglutils/lighting/Material.java
index 952e8f8..a709423 100644
--- a/src/net/java/joglutils/lighting/Material.java
+++ b/src/net/java/joglutils/lighting/Material.java
@@ -85,6 +85,10 @@ public class Material {
public Material(GL gl, int face) {
this.attachedGL = gl;
this.face = face;
+ this.specular = new float[4];
+ this.ambient = new float[4];
+ this.diffuse = new float[4];
+ this.emissive = new float[4];
this.retrieve();
}
/**
@@ -147,15 +151,14 @@ public class Material {
FloatBuffer buff = FloatBuffer.allocate(17);
gl.glGetMaterialfv(retrievalFace,gl.GL_SPECULAR,buff);
- gl.glGetMaterialfv(retrievalFace,gl.GL_EMISSION,buff);
- gl.glGetMaterialfv(retrievalFace,gl.GL_AMBIENT,buff);
- gl.glGetMaterialfv(retrievalFace,gl.GL_DIFFUSE,buff);
- gl.glGetMaterialfv(retrievalFace,gl.GL_SHININESS,buff);
-
buff.get(this.specular);
+ gl.glGetMaterialfv(retrievalFace,gl.GL_EMISSION,buff);
buff.get(this.emissive);
+ gl.glGetMaterialfv(retrievalFace,gl.GL_AMBIENT,buff);
buff.get(this.ambient);
+ gl.glGetMaterialfv(retrievalFace,gl.GL_DIFFUSE,buff);
buff.get(this.diffuse);
+ gl.glGetMaterialfv(retrievalFace,gl.GL_SHININESS,buff);
this.shininess = buff.get();
}
/**