zombie.core.Styles
Class AbstractStyle

java.lang.Object
  extended by zombie.core.Styles.AbstractStyle
All Implemented Interfaces:
Style
Direct Known Subclasses:
LightingStyle, TransparentStyle

public abstract class AbstractStyle
extends java.lang.Object
implements Style

Convenient base class implementation of Style


Constructor Summary
AbstractStyle()
           
 
Method Summary
 GeometryData build()
          If not rendering a sprite, then we perform a build() to create GeometryData Later, render() is called, with a vertex offset position and index offset position.
 AlphaOp getAlphaOp()
           
 boolean getRenderSprite()
          Whether to actually render a sprite when using this Style.
 int getStyleID()
           
 void render(int vertexOffset, int indexOffset)
          If not rendering a sprite, then render stuff.
 void resetState()
          Called to reset GL rendering state after actual drawing is done.
 void setupState()
          Called to set up GL rendering state before actual drawing is done.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStyle

public AbstractStyle()
Method Detail

getRenderSprite

public boolean getRenderSprite()
Description copied from interface: Style
Whether to actually render a sprite when using this Style.

Specified by:
getRenderSprite in interface Style
Returns:
boolean

getAlphaOp

public AlphaOp getAlphaOp()
Specified by:
getAlphaOp in interface Style
Returns:
the style's alpha operation

getStyleID

public int getStyleID()
Specified by:
getStyleID in interface Style
Returns:
the style's ID, which affects its rendering order

resetState

public void resetState()
Description copied from interface: Style
Called to reset GL rendering state after actual drawing is done.

Specified by:
resetState in interface Style

setupState

public void setupState()
Description copied from interface: Style
Called to set up GL rendering state before actual drawing is done.

Specified by:
setupState in interface Style

build

public GeometryData build()
Description copied from interface: Style
If not rendering a sprite, then we perform a build() to create GeometryData Later, render() is called, with a vertex offset position and index offset position. Return null if you are going to handle your own VBOs in Style.setupState().

Specified by:
build in interface Style
Returns:
the vertex data, or null

render

public void render(int vertexOffset,
                   int indexOffset)
Description copied from interface: Style
If not rendering a sprite, then render stuff. Our geometry was written to a pre-prepared buffer which is pointed to already.

Specified by:
render in interface Style