hmi.graphics.opengl.state
Class GLCapability

java.lang.Object
  extended by hmi.graphics.opengl.state.GLCapability
All Implemented Interfaces:
GLRenderObject, GLStateComponent

public class GLCapability
extends Object
implements GLStateComponent

A GLCapability is a wrapper for some OpenGL capability. The capability will be enabled or disabled when the glInit() or glRender() method is called, depending on the current state of the GLCapability object.

Author:
Job Zwiers

Field Summary
private  boolean enabled
           
private  int glId
           
private  int scId
           
 
Constructor Summary
GLCapability(int glId, boolean enabled)
          Create a new capability (i.e. a boolean valued GLStateComponent)
 
Method Summary
 boolean equals(Object obj)
          Equality test based upon GLStateComponent id and boolean value
 int getSCId()
          Returns an integer that uniquely identifies the type of the GLStateComponent.
 void glInit(GLRenderContext gl)
          Called during OpenGL initialization.
 void glRender(GLRenderContext gl)
          Called during openGL rendering.
 int hashCode()
          hash code consistent with equals.
 boolean isEnabled()
          Returns the state of this GLCapability.
 void setEnabled(boolean enabled)
          Sets the state of this GLCapability to the specified boolean value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

enabled

private boolean enabled

glId

private int glId

scId

private int scId
Constructor Detail

GLCapability

public GLCapability(int glId,
                    boolean enabled)
Create a new capability (i.e. a boolean valued GLStateComponent)

Method Detail

setEnabled

public void setEnabled(boolean enabled)
Sets the state of this GLCapability to the specified boolean value.


isEnabled

public boolean isEnabled()
Returns the state of this GLCapability.


equals

public boolean equals(Object obj)
Equality test based upon GLStateComponent id and boolean value

Overrides:
equals in class Object

hashCode

public int hashCode()
hash code consistent with equals.

Overrides:
hashCode in class Object

glInit

public void glInit(GLRenderContext gl)
Description copied from interface: GLRenderObject
Called during OpenGL initialization.

Specified by:
glInit in interface GLRenderObject

glRender

public final void glRender(GLRenderContext gl)
Description copied from interface: GLRenderObject
Called during openGL rendering.

Specified by:
glRender in interface GLRenderObject

getSCId

public final int getSCId()
Description copied from interface: GLStateComponent
Returns an integer that uniquely identifies the type of the GLStateComponent.

Specified by:
getSCId in interface GLStateComponent

toString

public String toString()
Overrides:
toString in class Object