Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# IdeShader Class Reference

The interface for vertex and pixel shaders. More...

`#include <deDriver.hpp>`

Inheritance diagram for IdeShader:

[legend]
Collaboration diagram for IdeShader:

[legend]
List of all members.

## Public Types
enum | ShaderType { SHADER_INVALID = -1, SHADER_VERTEX, SHADER_PIXEL, SHADER_FORCE_32BIT = 0x7FFFFFFF }
| Shader types. More...
enum | deShaderInstructionType { INSTRUCTION_VERSION_VERTEX = 0, INSTRUCTION_VERSION_PIXEL, INSTRUCTION_ADD, INSTRUCTION_DP3, INSTRUCTION_DP4, INSTRUCTION_DST, INSTRUCTION_EXPP, INSTRUCTION_LIT, INSTRUCTION_LOGP, INSTRUCTION_MAD, INSTRUCTION_MAX, INSTRUCTION_MIN, INSTRUCTION_MOV, INSTRUCTION_MUL, INSTRUCTION_RCP, INSTRUCTION_RSQ, INSTRUCTION_SGE, INSTRUCTION_SLT, INSTRUCTION_SUB, INSTRUCTION_DECLARE_CONSTANT, INSTRUCTION_DECLARE_MATRIX, INSTRUCTION_FORCE_32BIT = 0x7FFFFFFF }
| Shader instruction types. More...
enum | Argument { ARGUMENT_INVALID = 0, ARGUMENT_VERSION_1 = 0x00000001, ARGUMENT_CONSTANT = 0x00010000, ARGUMENT_TEMP = 0x00610000, ARGUMENT_VERTEX = 0x006D0000, ARGUMENT_OUTPOS = 0x007D0000, ARGUMENT_OUTCOLOR = 0x007E0000, ARGUMENT_OUTFOG = 0x00800000, ARGUMENT_OUTPTS = 0x00810000, ARGUMENT_OUTTEX = 0x00820000, ARGUMENT_OUTTEX_END = 0x008A0000, ARGUMENT_DE_TRANSFORM = 0, ARGUMENT_DE_PROJECTION = 1, ARGUMENT_DE_TRANSFORM_PROJECTION = 2, ARGUMENT_DE_IDENTITY = 3, ARGUMENT_DE_INVERSE = 4, ARGUMENT_DE_TRANSPOSE = 5, ARGUMENT_DE_INVERSE_TRANSPOSE = 6, ARGUMENT_FORCE_32BIT = 0x7FFFFFFF }
## Public Member Functions
virtual deBoolean | Assemble (char *Code, void(*ErrorCallback)(long LineNumber, char *Error))=0
virtual deBoolean | Disassemble (deString *Code)=0
virtual ShaderType | GetShaderType () const=0
| Returns the shader's type.
virtual long | GetInstructionCount () const=0
| Returns the number of instructions the shader contains.
virtual const deTArray< deShaderInstruction > * | GetInstructions () const=0
| Return the shader's instruction array.
virtual long | GetConstantCount () const=0
| Return the number of constants the shader contains.
virtual const deTArray< deShaderConstant > * | GetConstants () const=0
| Return the shader's constant array.
virtual deBoolean | Write (IdeFile *File) const=0
virtual deBoolean | Read (IdeFile *File)=0
virtual deBoolean | SetDriverShader (void *Shader)=0
virtual void * | GetDriverShader () const=0
| Called by the driver. Returns the driver's private data.
## Protected Member Functions
virtual | ~IdeShader ()

## Detailed Description

The interface for vertex and pixel shaders.

## Member Enumeration Documentation

enum IdeShader::Argument

  | Enumeration values:
  ARGUMENT_INVALID | Invalid Argument.
  ARGUMENT_VERSION_1 | 1.0 version argument
  ARGUMENT_CONSTANT | Constant registers start.
  ARGUMENT_TEMP | Temporary registers start.
  ARGUMENT_VERTEX | Vertex data registers Start.
  ARGUMENT_OUTPOS | Output position register.
  ARGUMENT_OUTCOLOR | Output color registers.
  ARGUMENT_OUTFOG | Output fog register.
  ARGUMENT_OUTPTS | Point size register.
  ARGUMENT_OUTTEX | Output texture coordinates registers start.
  ARGUMENT_OUTTEX_END | Output texture coordinates registers end.
  ARGUMENT_DE_TRANSFORM | DE_TRANSFORM argument.
  ARGUMENT_DE_PROJECTION | DE_PROJECTION argument.
  ARGUMENT_DE_TRANSFORM_PROJECTION | DE_TRANSFORM_PROJECTION argument.
  ARGUMENT_DE_IDENTITY | DE_IDENTITY argument.
  ARGUMENT_DE_INVERSE | DE_INVERSE argument.
  ARGUMENT_DE_TRANSPOSE | DE_TRANSPOSE argument.
  ARGUMENT_DE_INVERSE_TRANSPOSE | DE_INVERSE_TRANSPOSE argument.
  ARGUMENT_FORCE_32BIT | Force a 32-Bit enumeration.

enum IdeShader::deShaderInstructionType

  | Shader instruction types. Enumeration values:
  INSTRUCTION_VERSION_VERTEX | Vertex Shader Version Instruction.
  INSTRUCTION_VERSION_PIXEL | Pixel Shader Version Instruction.
  INSTRUCTION_ADD | "add" instruction
  INSTRUCTION_DP3 | "dp3" instruction
  INSTRUCTION_DP4 | "dp4" instruction
  INSTRUCTION_DST | "dst" instruction
  INSTRUCTION_EXPP | "expp" instruction
  INSTRUCTION_LIT | "lit" instruction
  INSTRUCTION_LOGP | "logp" instruction
  INSTRUCTION_MAD | "mad" instruction
  INSTRUCTION_MAX | "max" instruction
  INSTRUCTION_MIN | "min" instruction
  INSTRUCTION_MOV | "mov" instruction
  INSTRUCTION_MUL | "mul" instruction
  INSTRUCTION_RCP | "rcp" instruction
  INSTRUCTION_RSQ | "rsq" instruction
  INSTRUCTION_SGE | "sge" instruction
  INSTRUCTION_SLT | "slt" instruction
  INSTRUCTION_SUB | "sub" instruction
  INSTRUCTION_DECLARE_CONSTANT | "DECLARE_CONSTANT" instruction
  INSTRUCTION_DECLARE_MATRIX | "DECLARE_MATRIX" instruction
  INSTRUCTION_FORCE_32BIT | Force a 32-Bit enumeration.

enum IdeShader::ShaderType

  | Shader types. Enumeration values:
  SHADER_INVALID | Invalid Shader.
  SHADER_VERTEX | Vertex shader.
  SHADER_PIXEL | Pixel shader.
  SHADER_FORCE_32BIT | Force a 32 bit enum.

## Constructor & Destructor Documentation

virtual IdeShader::~IdeShader | ( |  | ) | `[inline, protected, virtual]`

## Member Function Documentation

virtual deBoolean IdeShader::Assemble | ( | char * | Code,
|  | void(* | ErrorCallback)(long LineNumber, char *Error)
| ) | `[pure virtual]`

  | Assembles a shader. Parameters:
  Code | [in] Shader code to assemble.
  ErrorCallback | [in] Callback function that is called when parsing errors occur.
Implemented in deShader.

virtual deBoolean IdeShader::Disassemble | ( | deString * | Code | ) | `[pure virtual]`

  | Disassembles the shader. Parameters:
  Code | [out] A pointer to a valid deString to put the shader code in.
Implemented in deShader.

virtual long IdeShader::GetConstantCount | ( |  | ) | const`[pure virtual]`

| Return the number of constants the shader contains. Implemented in deShader.

virtual const deTArray<deShaderConstant>* IdeShader::GetConstants | ( |  | ) | const`[pure virtual]`

| Return the shader's constant array. Implemented in deShader.

virtual void* IdeShader::GetDriverShader | ( |  | ) | const`[pure virtual]`

| Called by the driver. Returns the driver's private data. Implemented in deShader.

virtual long IdeShader::GetInstructionCount | ( |  | ) | const`[pure virtual]`

| Returns the number of instructions the shader contains. Implemented in deShader.

virtual const deTArray<deShaderInstruction>* IdeShader::GetInstructions | ( |  | ) | const`[pure virtual]`

| Return the shader's instruction array. Implemented in deShader.

virtual ShaderType IdeShader::GetShaderType | ( |  | ) | const`[pure virtual]`

| Returns the shader's type. Implemented in deShader.

virtual deBoolean IdeShader::Read | ( | IdeFile * | File | ) | `[pure virtual]`

  | Reads an assembled shader from a file Parameters:
  FileSystem | [in] A pointer to a valid IdeFileSystem to read a shader from
Implemented in deShader.

virtual deBoolean IdeShader::SetDriverShader | ( | void * | Shader | ) | `[pure virtual]`

  | Called by the driver to set driver specific shader data Parameters:
  Shader | [in] A pointer to the driver's private data
Implemented in deShader.

virtual deBoolean IdeShader::Write | ( | IdeFile * | File | ) | const`[pure virtual]`

  | Writes the assembled shader to a file Parameters:
  FileSystem | [in] A pointer to a valid IdeFileSystem to write to
Implemented in deShader.

The documentation for this class was generated from the following file:

- deDriver.hpp