This class is for using shaders.
More...
#include <Shader.h>
Public Member Functions |
| | Shader (const u32 Handle, const char *FileName, const char *Name, void *ExtraParam) |
| | Constructor.
|
| virtual | ~Shader () |
| | Destructor.
|
| virtual ShaderHandle | GetConstatnt (const char *Name) |
| virtual bool | SetConstant (ShaderHandle Handler, const float *Values, u32 Count) |
| virtual bool | SetConstant (ShaderHandle Handler, const int *Values, u32 Count) |
| virtual bool | SetConstant (const float *Values, u32 StartRegisterIndex, u32 Count=1) |
| virtual void | ConnectOnPreRender (kge::core::Functor0< void > *pFun) |
| virtual void | PreRender () |
| virtual void | Render () |
| virtual int | GetTextureIndex (const char *Name) |
| | Returns the texture stage.
|
| | Resource (const u32 Handle, const char *FileName, const char *Name, void *ExtraParam) |
| | Constructor.
|
| virtual | ~Resource () |
| | Destructor.
|
| virtual const char * | GetFileName () |
| | Return resource file name.
|
| virtual const char * | GetName () |
| | Return resource name.
|
| virtual u32 | GetHandle () |
| | Return resource handle.
|
| | KgeUnknown () |
| | Constructor.
|
| virtual | ~KgeUnknown () |
| | Destructor.
|
| virtual void | AddRef () |
| | Add a reference to the object.
|
| virtual void | DecRef () |
| | Decrease a reference from the object. if its reference count get 0 then the object will destroy.
|
| u32 | GetRefCount () |
| | Return resource reference count.
|
| const char * | GetDebugText () |
| | returns the instance debug text.
|
Detailed Description
This class is for using shaders.
Definition at line 28 of file Shader.h.
Constructor & Destructor Documentation
| kge::gfx::Shader::Shader |
( |
const u32 |
Handle, |
|
|
const char * |
FileName, |
|
|
const char * |
Name, |
|
|
void * |
ExtraParam |
|
) |
| |
|
inline |
Constructor.
Definition at line 33 of file Shader.h.
| virtual kge::gfx::Shader::~Shader |
( |
| ) |
|
|
inlinevirtual |
Destructor.
Definition at line 37 of file Shader.h.
Member Function Documentation
Connect your function to this class with this function so the engine can call it.
Sample code:
class A
{
public:
void SetShaderConstants()
{
m_pShader->Set ...
}
protected:
};
void SetShaderConstants()
{
shader->Set ...
}
int main()
{
A a;
}
Definition at line 109 of file Shader.h.
References m_pFun.
| virtual ShaderHandle kge::gfx::Shader::GetConstatnt |
( |
const char * |
Name | ) |
|
|
inlinevirtual |
Get the pointer for accessing constants in the shader code. The shader constants are write only.
- Parameters
-
| Name | The constant name that you defined in the shader code. |
- Returns
- Returns the pointer that you must use it in the SetConstant function.
Definition at line 44 of file Shader.h.
References NULL.
| virtual int kge::gfx::Shader::GetTextureIndex |
( |
const char * |
Name | ) |
|
|
inlinevirtual |
Returns the texture stage.
Definition at line 127 of file Shader.h.
| virtual void kge::gfx::Shader::PreRender |
( |
| ) |
|
|
inlinevirtual |
| virtual void kge::gfx::Shader::Render |
( |
| ) |
|
|
inlinevirtual |
This function is for internal use. Active the shader in graphics card.
Definition at line 124 of file Shader.h.
| virtual bool kge::gfx::Shader::SetConstant |
( |
ShaderHandle |
Handler, |
|
|
const float * |
Values, |
|
|
u32 |
Count |
|
) |
| |
|
inlinevirtual |
Set a shader variable with it's handler.
- Parameters
-
| Handler | The handler to the shader variable. |
| Values | The pointer to the values. |
| Count | Array size. |
- Returns
- Returns true if succeed.
Definition at line 55 of file Shader.h.
| virtual bool kge::gfx::Shader::SetConstant |
( |
ShaderHandle |
Handler, |
|
|
const int * |
Values, |
|
|
u32 |
Count |
|
) |
| |
|
inlinevirtual |
| virtual bool kge::gfx::Shader::SetConstant |
( |
const float * |
Values, |
|
|
u32 |
StartRegisterIndex, |
|
|
u32 |
Count = 1 |
|
) |
| |
|
inlinevirtual |
Set shader registers.
- Parameters
-
| Values | The data you want to set in the vertex shader register. |
| StartRegisterIndex | The index of the start constant register like c3 |
| Count | Amount of registers to be set. One register consists of 4 floats. |
- Returns
- Returns true if succeed.
Definition at line 70 of file Shader.h.
Member Data Documentation
The documentation for this class was generated from the following file: