crystalspace.jbind.impl.video.shader.shader
Class csShader

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.video.shader.shader.csShader
All Implemented Interfaces:
iBase, iPointer, iShader, iShaderVariableContext

public class csShader
extends csBase
implements iShader

Author:
Quentin Anciaux

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csShader(iPointer nPointer)
           
 
Method Summary
 boolean activatePass(int number)
          Activate a pass for rendering.
 void addVariable(csShaderVariable variable)
          Add a variable to this context.
 boolean deactivatePass()
          Completly deactivate a pass.
 int fillVariableList(csShaderVariableProxyList list)
          Fill a csShaderVariableList.
 java.lang.String getName()
          Retrieve name of shader.
 int getNumberOfPasses()
          Get number of passes this shader have.
 csShaderVariable getVariable(int name)
          Get a named variable from this context.
 csShaderVariable getVariableAdd(int name)
          Like GetVariable();, but it also adds it if doesn't exist already.
 csShaderVariable getVariableRecursive(int name)
          Get a named variable from this context, and any context above/outer.
 csShaderVariable getVariableRecursiveAdd(int name)
          Like GetVariable();, but it also adds it if doesn't exist already.
 int getVersion()
          Return the version of the interface
protected  boolean isNativePointerValidSafe(long pointer)
           
 boolean setupPass(csRenderMesh mesh, iShaderVariableContext[] dynamicDomains)
          Setup a pass.
 boolean teardownPass()
          Tear down current state, and prepare for a new mesh (for which SetupPass is called);.
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csShader

public csShader(iPointer nPointer)
Parameters:
nPointer -
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase
See Also:
iBase.getVersion()

getName

public java.lang.String getName()
Description copied from interface: iShader
Retrieve name of shader.

Specified by:
getName in interface iShader
Specified by:
getName in class csBase
See Also:
iBase.getName()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe(long pointer)
Specified by:
isNativePointerValidSafe in class csNativeObject
See Also:
csNativeObject.isNativePointerValidSafe(long)

activatePass

public boolean activatePass(int number)
Description copied from interface: iShader
Activate a pass for rendering.

Specified by:
activatePass in interface iShader
Parameters:
number -
Returns:
See Also:
iShader.activatePass(int)

deactivatePass

public boolean deactivatePass()
Description copied from interface: iShader
Completly deactivate a pass.

Specified by:
deactivatePass in interface iShader
Returns:
See Also:
iShader.deactivatePass()

getNumberOfPasses

public int getNumberOfPasses()
Description copied from interface: iShader
Get number of passes this shader have.

Specified by:
getNumberOfPasses in interface iShader
Returns:
See Also:
iShader.getNumberOfPasses()

setupPass

public boolean setupPass(csRenderMesh mesh,
                         iShaderVariableContext[] dynamicDomains)
Description copied from interface: iShader
Setup a pass.

Specified by:
setupPass in interface iShader
Parameters:
mesh -
dynamicDomains -
Returns:
See Also:
iShader.setupPass(crystalspace.jbind.impl.video.rendermesh.csRenderMesh, crystalspace.jbind.interfaces.ivideo.shader.shader.iShaderVariableContext[])

teardownPass

public boolean teardownPass()
Description copied from interface: iShader
Tear down current state, and prepare for a new mesh (for which SetupPass is called);.

Specified by:
teardownPass in interface iShader
Returns:
See Also:
iShader.teardownPass()

addVariable

public void addVariable(csShaderVariable variable)
Description copied from interface: iShaderVariableContext
Add a variable to this context. Referenced by GetVariableAdd();, and GetVariableRecursiveAdd();.

Specified by:
addVariable in interface iShaderVariableContext
Parameters:
variable -
See Also:
iShaderVariableContext.addVariable(crystalspace.jbind.impl.csgfx.shadervar.csShaderVariable)

fillVariableList

public int fillVariableList(csShaderVariableProxyList list)
Description copied from interface: iShaderVariableContext
Fill a csShaderVariableList. Return number of variables filled.

Specified by:
fillVariableList in interface iShaderVariableContext
Parameters:
list -
Returns:
See Also:
iShaderVariableContext.fillVariableList(crystalspace.jbind.impl.csgfx.shadervar.csShaderVariableProxyList)

getVariable

public csShaderVariable getVariable(int name)
Description copied from interface: iShaderVariableContext
Get a named variable from this context. Referenced by GetVariableAdd();.

Specified by:
getVariable in interface iShaderVariableContext
Parameters:
name -
Returns:
See Also:
iShaderVariableContext.getVariable(int)

getVariableAdd

public csShaderVariable getVariableAdd(int name)
Description copied from interface: iShaderVariableContext
Like GetVariable();, but it also adds it if doesn't exist already. Definition at line 69 of file shader.h. References AddVariable();, csStringID, and GetVariable();.

Specified by:
getVariableAdd in interface iShaderVariableContext
Parameters:
name -
Returns:
See Also:
iShaderVariableContext.getVariableAdd(int)

getVariableRecursive

public csShaderVariable getVariableRecursive(int name)
Description copied from interface: iShaderVariableContext
Get a named variable from this context, and any context above/outer. Referenced by GetVariableRecursiveAdd();.

Specified by:
getVariableRecursive in interface iShaderVariableContext
Parameters:
name -
Returns:
See Also:
iShaderVariableContext.getVariableRecursive(int)

getVariableRecursiveAdd

public csShaderVariable getVariableRecursiveAdd(int name)
Description copied from interface: iShaderVariableContext
Like GetVariable();, but it also adds it if doesn't exist already. Definition at line 84 of file shader.h. References AddVariable();, csStringID, and GetVariableRecursive();

Specified by:
getVariableRecursiveAdd in interface iShaderVariableContext
Parameters:
name -
Returns:
See Also:
iShaderVariableContext.getVariableRecursiveAdd(int)