libgdx API

com.badlogic.gdx.graphics.g3d
Class Material

java.lang.Object
  extended by com.badlogic.gdx.graphics.g3d.Material

public class Material
extends java.lang.Object

Holds material data. The data contains texture/shader information and material properties for lighting. Currently the material also supports partial serialization of its data.

Author:
Dave Clayton

Field Summary
 Color Ambient
           
 int BlendDestFactor
           
 int BlendSourceFactor
           
 Color Diffuse
           
 Color Emissive
           
 java.lang.String Name
           
 ShaderProgram Shader
           
 Color Specular
           
 TextureRef Texture
           
 java.lang.String TexturePath
           
 
Constructor Summary
Material(java.lang.String name)
          Constructs a new material.
 
Method Summary
 boolean read(java.io.DataInputStream i)
          Serialization.
 void set(int face)
          Sends the material properties to the OpenGL state.
 boolean write(java.io.DataOutputStream o)
          Serialization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Name

public java.lang.String Name

Shader

public ShaderProgram Shader

Texture

public TextureRef Texture

TexturePath

public java.lang.String TexturePath

Ambient

public Color Ambient

Diffuse

public Color Diffuse

Specular

public Color Specular

Emissive

public Color Emissive

BlendSourceFactor

public int BlendSourceFactor

BlendDestFactor

public int BlendDestFactor
Constructor Detail

Material

public Material(java.lang.String name)
Constructs a new material.

Parameters:
name - The material's name.
Method Detail

set

public void set(int face)
Sends the material properties to the OpenGL state.

Parameters:
face - Which faces this applies to (e.g. GL10.GL_FRONT).

read

public boolean read(java.io.DataInputStream i)
             throws java.io.IOException
Serialization. Experimental.

Parameters:
i - The DataInputStream to serialize from.
Returns:
whether serialization succeeded.
Throws:
java.io.IOException

write

public boolean write(java.io.DataOutputStream o)
              throws java.io.IOException
Serialization. Experimental.

Parameters:
o - The DataOutputStream to serialize to.
Returns:
Whether serialization succeeded.
Throws:
java.io.IOException

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)