![]() |
Kochol Game Engine
0.1.0
|
The Renderer interface has functions to work with graphics card. More...
#include <Renderer.h>
Public Member Functions | |
Renderer () | |
Constructor. | |
virtual | ~Renderer () |
Destructor. | |
virtual void | SetCallbacks (kgeRenderCallback clbk_OnLost, kgeRenderCallback clbk_OnReset) |
set callback functions for rendering device | |
virtual bool | Init (Device *device, InitParameters ¶ms)=0 |
Amade kardane Renderer. | |
virtual bool | Clear (bool Pixel, bool Zbuffer, bool Stencil)=0 |
Pak kardane pixel ha va buffer ha. | |
virtual bool | BeginRendering (bool ClearPixel, bool ClearZbuffer, bool ClearStencil)=0 |
Shroe be render gereftan. | |
virtual bool | CreateRenderableTexture (Texture **ppOutTexture, int width, int height, TextureFormat tf, bool CreateDepthStencilBuffer=true, bool AntiAliasing=false)=0 |
virtual void | EndRendering ()=0 |
End the Rendering. | |
virtual void | SetClearColor (const Colorf &ClearColor)=0 |
Set kardane Range pas zamine. | |
virtual void | SetCullingMode (CullMode cm)=0 |
Sets the culling mode. | |
virtual void | SetVertexBuffer (HardwareBuffer *pBuffer, int stage=0)=0 |
Sets the vertex buffer for multi streaming. | |
virtual void | SetIndexBuffer (HardwareBuffer *pBuffer)=0 |
Sets the index buffer for rendering. | |
virtual void | SetRenderTarget (int RenderNumber=0, Texture *RenderTarget=NULL)=0 |
virtual void | SetViewLookatLH (math::Vector &Position, math::Vector &Lookat, math::Vector &UpDirection)=0 |
virtual void | SetViewLookatRH (math::Vector &Position, math::Vector &Lookat, math::Vector &UpDirection)=0 |
virtual void | SetPerspectiveLH (float Fov=0.7853f, float NearPlane=1.0f, float FarPlane=1000.0f)=0 |
Matrixe Projection ro set mikone Be sorate Chap Dast. | |
virtual void | SetPerspectiveRH (float Fov=0.8f, float NearPlane=1.0f, float FarPlane=1000.0f)=0 |
Matrixe Projection ro set mikone Be sorate Rast Dast. | |
virtual void | SetTransForm (math::Matrix *mat, TransformMode TM=ETM_World)=0 |
Matrix haye asli dorbin va ajsam ra taghir midahad. | |
virtual math::Matrix | GetTransForm (TransformMode TM=ETM_World)=0 |
Matrix haye asli dorbin va ajsam ra bar migardone. | |
int | GetFPS () |
Meghdar Frames Per Second ro bar migardone. | |
virtual bool | AddTexture (Texture **ppOutTexture, u32 Handle, const char *FileName, const char *Name, void *ExtraParam)=0 |
This function is for Texture Manager for adding textures use SceneManager AddTexture function instead. | |
virtual void | SetTexture (Texture *pTex, int index=0)=0 |
virtual void | Enable (RenderFlags RF)=0 |
virtual void | Disable (RenderFlags RF)=0 |
virtual void | SetMaterial (Material *pMaterial)=0 |
virtual void | SetTextureParams (TextureParams Params, int TextureStage=0)=0 |
virtual bool | CanDo (GraphicCardCaps Item)=0 |
virtual void | SetStencilBuffer (kge::efx::EffectType ET, u8 State)=0 |
virtual void | AddFont (kge::gui::Font **ppOut, const char *strFontName, ul32 FontSize)=0 |
Create font base on API type. | |
virtual HardwareBuffer * | CreateVertexBuffer (void *Vertices, u32 VCount, VertexType eVType=EVT_V3TN, bool isDynamic=false)=0 |
virtual HardwareBuffer * | CreateVertexBuffer (void *Vertices, u32 VCount, u32 Stride, bool isDynamic=false)=0 |
virtual HardwareBuffer * | CreateIndexBuffer (void *Indices, u32 ICount, IndexBufferType eIndexBufferType=EIBT_16Bit, bool isDynamic=false)=0 |
Creates an Index buffer on video memory. | |
virtual void | DrawTriangleList (HardwareBuffer *VB, HardwareBuffer *IB, u32 VCount, u32 ICount, VertexType eVType=EVT_V3TN)=0 |
virtual void | DrawTriangleList (u32 VCount, u32 ICount, VertexDec *CV, u32 VertexStart, u32 StartIndex)=0 |
virtual Shader * | CreateVertexShaderFromFile (const char *VertexFileName, const char *VertexMain="VSMain", ShaderVersion eVVersion=ESV_VS1_1)=0 |
virtual Shader * | CreateVertexShaderFromString (const char *VertexCode, const char *VertexMain="VSMain", ShaderVersion eVVersion=ESV_VS1_1)=0 |
virtual Shader * | CreatePixelShaderFromFile (const char *PixelFileName, const char *PixelMain="PSMain", ShaderVersion ePVersion=ESV_PS1_1)=0 |
virtual Shader * | CreatePixelShaderFromString (const char *PixelCode, const char *PixelMain="PSMain", ShaderVersion ePVersion=ESV_PS1_1)=0 |
virtual Texture * | CreateTexture (ImageData *pImg)=0 |
virtual bool | AddVertexShader (Shader **ppOutShader, u32 handle, const char *fileName, const char *mainName, void *extraParam)=0 |
virtual bool | AddPixelShader (Shader **ppOutShader, u32 handle, const char *fileName, const char *mainName, void *extraParam)=0 |
virtual Material * | GetLastMaterial () |
Returns the last material used to render. | |
virtual RendererAPI | GetRendererType ()=0 |
Returns the renderer type (DirectX or OpenGL) | |
virtual bool | SetFog (FogType mode, Colorf FogColor, float expDensity=0, float linearStart=0, float linearEnd=1000000)=0 |
virtual bool | SetVideoMode (int Width, int Height, int Bits, bool UseStencil=false, bool Fullscreen=false, int MultiSample=0, bool VSync=false)=0 |
virtual u32 | GetTriangleCount () |
returns the number of triangle rendered. | |
virtual u32 | GetDrawCallsCount () |
returns the number of draw functions called. | |
virtual void | SetMainSceneManager (sn::SceneManager *smgr) |
For internal use. | |
virtual void | SetViewPort (const core::RectI &viewport)=0 |
Sets the rendering view port. | |
virtual bool | GetRenderFlag (RenderFlags r) |
virtual void * | GetDirect3dDevice () |
Returns the direct 3d device. | |
virtual int | GetWindowWidth () |
Returns the width of the rendering area. | |
virtual int | GetWindowHeight () |
Returns the width of the rendering area. | |
virtual VertexDec * | CreateVertexDeclaration (CustomVertexElement *pVertexInfoArray, core::stringc sName)=0 |
Create a custom vertex declaration and returns its pointer. | |
virtual void | SetVertexDec (VertexDec *pVD)=0 |
Sets the vertex declaration. | |
VertexDec * | GetVertexDec (VertexType evt) |
Returns the default vertex declaration. | |
virtual void | SetRenderingWindow (void *hwnd)=0 |
Set the second rendering window. | |
virtual void | OnResize (int width, int height)=0 |
Resize the view port and rendering. | |
virtual void | OnResize (unsigned int width, unsigned int height, bool fullscreen, bool vsync)=0 |
Change resolution, toggle full screen, turn on/off vertical sync. | |
virtual void | SetStreamSourceFreq (u32 StreamID, u32 Count)=0 |
Sets the stream source frequency for rendering instanced meshes. | |
void | SetMaxTextureSize (u32 maxTextureSize) |
u32 | GetMaxTextureSize () const |
virtual void | SetDepthBias (float fBias)=0 |
Sets the depth bias. | |
virtual void | SetDepthBiasSlope (float fSlope)=0 |
Sets the depth bias slope. | |
virtual void | SetRendererPipeline (RendererPipeline rp) |
Sets the renderer pipeline. | |
virtual RendererPipeline | GetRendererPipeline () |
Gets the current renderer pipeline. | |
virtual Texture * | GetPositionMap () |
Returns the position map. | |
virtual Texture * | GetNormalMap () |
Returns the normal map. | |
virtual Texture * | GetDiffuseMap () |
Returns the Diffuse map. | |
virtual void | DrawScreenQuad () |
Draw a screen quad on screen. Note the 2D mode must be enabled before this action. | |
virtual void | SetFarPlaneAsScreenQuad (sn::Camera *pCam) |
Sets the camera far plane as screen quad vectors. | |
virtual void | SetDepthMode (DepthTestMode e=EDTM_LessEqual)=0 |
Sets the depth test mode. | |
virtual void | SetScissorRegion (int x, int y, int width, int height) |
Sets the scissor properties. | |
void | SetVertexBufferID (u32 id, int index) |
For internal use. | |
void | SetIndexBufferID (u32 id) |
For internal use. | |
![]() | |
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. |
Static Public Member Functions | |
static Renderer * | GetSingletonPtr () |
Returns the Renderer class pointer. |
Public Attributes | |
Lighting * | Lights |
Tamame kar ba norha dar in pointer gharar darad. |
Protected Member Functions | |
virtual bool | AfterInit ()=0 |
virtual void | InitGCC ()=0 |
virtual void | AddVertexDec (VertexDec *pVD) |
Adds VertexDec pointers. | |
virtual void | AddHardwareBuffer (HardwareBuffer *pHB) |
Adds hardware buffer pointer. | |
![]() | |
void | SetDebugText (char *text) |
Protected Attributes | |
Device * | m_pDevice |
sn::SceneManager * | m_pSnmgr |
InitParameters | m_Params |
Colorf | m_cClearColor |
bool | m_bIsSceneRunning |
bool | m_bUseShaders |
core::Timer * | m_pTimer |
int | m_iFPS |
int | m_iFPSTemp |
u32 | m_nTextID [8] |
u32 | m_nVertexBufferID [16] |
u32 | m_nIndexBufferID |
u32 | m_nVertexDecID |
bool | m_bRF [ERF_Count] |
bool | m_bGCC [EGCC_Count] |
Material * | m_pLastMaterial |
u32 | m_iTriCount |
u32 | m_iDrawCount |
u32 | m_iBatchCount |
core::RectI | m_rViewPort |
VertexDec ** | m_ppVertexDecs |
Vertex declarations. | |
std::vector< VertexDec * > | m_vVertexDecs |
The created VertexDec pointers. | |
std::vector< HardwareBuffer * > | m_vBuffers |
The created buffer pointers. | |
RendererPipeline | m_eRendererPipeline |
Texture * | m_pPosMap |
Texture * | m_pDifMap |
Texture * | m_pNorMap |
gui::Image * | m_pScreenQuad |
kgeRenderCallback | m_clbk_OnLost |
rendering callbacks | |
kgeRenderCallback | m_clbk_OnReset |
The Renderer interface has functions to work with graphics card.
Definition at line 142 of file Renderer.h.
kge::gfx::Renderer::Renderer | ( | ) |
Constructor.
|
virtual |
Destructor.
|
pure virtual |
Create font base on API type.
|
protectedvirtual |
Adds hardware buffer pointer.
|
pure virtual |
|
pure virtual |
This function is for Texture Manager for adding textures use SceneManager AddTexture function instead.
|
protectedvirtual |
Adds VertexDec pointers.
|
pure virtual |
|
protectedpure virtual |
|
pure virtual |
Shroe be render gereftan.
|
pure virtual |
Check for graphics card capabilities
Item | Ghabeliyati ke mikhahid check shavad. |
|
pure virtual |
Pak kardane pixel ha va buffer ha.
|
pure virtual |
Creates an Index buffer on video memory.
|
pure virtual |
Load a pixel shader from a file then compile it and return the created pixel shader.
PixelFileName | The file name that contain the pixel shader source code. |
PixelMain | The main pixel shader function name. |
ePVersion | The pixel shader version that the code must be compiled in that version. |
|
pure virtual |
Load a pixel shader from a string then compile it and return the created pixel shader.
PixelCode | The string that contain the pixel shader source code. |
PixelMain | The main pixel shader function name. |
ePVersion | The pixel shader version that the code must be compiled in that version. |
|
pure virtual |
Creates a renderable texture to use it as a render target
width | The texture width |
height | The texture height |
tf | Texture color format |
Creates a texture from an ImageData
|
pure virtual |
Create a vertex buffer and store it on video memory.
Vertices | A pointer to the Vertices array. |
VCount | The Vertices count. |
eVType | The vertex type default value = EVT_V3TN witch is a vertex with texture and normal vector. |
|
pure virtual |
Create a vertex buffer from custom vertex type and store it on video memory.
Vertices | A pointer to the Vertices array. |
VCount | The Vertices count. |
Stride | The vertex struct size in bytes. |
|
pure virtual |
Create a custom vertex declaration and returns its pointer.
|
pure virtual |
Load a vertex shader from a file then compile it and return the created vertex shader.
VertexFileName | The file name that contain the vertex shader source code. |
VertexMain | The main vertex shader function name. |
eVVersion | The vertex shader version that the code must be compiled in that version. |
|
pure virtual |
Load a vertex shader from a string then compile it and return the created vertex shader.
VertexCode | The string that contain the vertex shader source code. |
VertexMain | The main vertex shader function name. |
eVVersion | The vertex shader version that the code must be compiled in that version. |
PixelCode | The string that contain the pixel shader source code. |
PixelMain | The main pixel shader function name. |
ePVersion | The pixel shader version that the code must be compiled in that version. |
|
pure virtual |
Disable kardane khsiyat haye render.
RF | Parchami ke mikhahid Disable shavad. |
|
virtual |
Draw a screen quad on screen. Note the 2D mode must be enabled before this action.
|
pure virtual |
Draw a vertex buffer
VBid | Vertex buffer index. |
VCount | The Vertices count. |
ICount | The Indices couont. |
eVType | The vertex type default value = EVT_V3TN witch is a vertex with texture and normal vector. |
|
pure virtual |
Draw a vertex buffer you must set the buffers manually before calling this function this function is good for multi streaming
VCount | The Vertices count. |
ICount | The Indices count. |
CV | custom vertex pointer |
|
pure virtual |
Enable kardane khsiyat haye render.
RF | Parchami ke mikhahid enable shavad. |
|
pure virtual |
End the Rendering.
|
inlinevirtual |
Returns the Diffuse map.
Definition at line 471 of file Renderer.h.
|
inlinevirtual |
|
inlinevirtual |
returns the number of draw functions called.
Definition at line 409 of file Renderer.h.
|
inline |
Meghdar Frames Per Second ro bar migardone.
Definition at line 247 of file Renderer.h.
|
inlinevirtual |
Returns the last material used to render.
Definition at line 393 of file Renderer.h.
u32 kge::gfx::Renderer::GetMaxTextureSize | ( | ) | const |
|
inlinevirtual |
Returns the normal map.
Definition at line 468 of file Renderer.h.
|
inlinevirtual |
Returns the position map.
Definition at line 465 of file Renderer.h.
|
inlinevirtual |
Gets the current renderer pipeline.
Definition at line 462 of file Renderer.h.
|
pure virtual |
Returns the renderer type (DirectX or OpenGL)
|
inlinevirtual |
Definition at line 417 of file Renderer.h.
|
pure virtual |
Matrix haye asli dorbin va ajsam ra bar migardone.
mat | Matrix taghir dahande. |
|
inlinevirtual |
returns the number of triangle rendered.
Definition at line 406 of file Renderer.h.
|
inline |
Returns the default vertex declaration.
Definition at line 435 of file Renderer.h.
|
inlinevirtual |
Returns the width of the rendering area.
Definition at line 426 of file Renderer.h.
|
inlinevirtual |
Returns the width of the rendering area.
Definition at line 423 of file Renderer.h.
|
pure virtual |
Amade kardane Renderer.
|
protectedpure virtual |
|
pure virtual |
Resize the view port and rendering.
|
pure virtual |
Change resolution, toggle full screen, turn on/off vertical sync.
|
virtual |
set callback functions for rendering device
|
pure virtual |
Set kardane Range pas zamine.
|
pure virtual |
Sets the culling mode.
|
pure virtual |
Sets the depth bias.
|
pure virtual |
Sets the depth bias slope.
|
pure virtual |
Sets the depth test mode.
|
virtual |
Sets the camera far plane as screen quad vectors.
|
pure virtual |
|
pure virtual |
Sets the index buffer for rendering.
|
inline |
For internal use.
Definition at line 489 of file Renderer.h.
|
inlinevirtual |
For internal use.
Definition at line 412 of file Renderer.h.
|
pure virtual |
Set kardane kamele ya matrial besorate automatic.
pMaterial | Materiali ke bayad set shavad ghabl az render. |
void kge::gfx::Renderer::SetMaxTextureSize | ( | u32 | maxTextureSize | ) |
|
pure virtual |
Matrixe Projection ro set mikone Be sorate Chap Dast.
Fov | Zavie dorbin. |
NearPlane | Parde joloyee. |
FarPlane | Parde aghabi. |
|
pure virtual |
Matrixe Projection ro set mikone Be sorate Rast Dast.
Fov | Zavie dorbin. |
NearPlane | Parde joloyee. |
FarPlane | Parde aghabi. |
|
virtual |
Sets the renderer pipeline.
|
pure virtual |
Set the second rendering window.
|
pure virtual |
Set the renderable target where renderer will render there.
RenderNumber | The target index you can use Multi Render Targets(MRT) with shaders. |
RenderTarget | A pointer to the texture that you want to render there pass NULL to render to screen. |
|
inlinevirtual |
Sets the scissor properties.
Definition at line 483 of file Renderer.h.
|
pure virtual |
Tanzimate stencil buffer baraye effect haye mokhtalef.
Sets the stream source frequency for rendering instanced meshes.
|
pure virtual |
Set a texture
|
pure virtual |
Set kardane keyfiyat texture ha va address mode ha.
Params | Noe keyfiyat texture va address mode ha. |
|
pure virtual |
Matrix haye asli dorbin va ajsam ra taghir midahad.
mat | Matrix taghir dahande. |
|
pure virtual |
Sets the vertex buffer for multi streaming.
|
inline |
For internal use.
Definition at line 486 of file Renderer.h.
|
pure virtual |
Sets the vertex declaration.
|
pure virtual |
|
pure virtual |
Sets camera for left-hand
Position | Jaee ke dorbin gharar migirad. |
Lookat | Jaee ke dorbin be anja negah mikonad. |
UpDirection | Bordari ke jahat bala ra moshakas mikonad. |
|
pure virtual |
Sets camera for right hand
Position | Jaee ke dorbin gharar migirad. |
Lookat | Jaee ke dorbin be anja negah mikonad. |
UpDirection | Bordari ke jahat bala ra moshakas mikonad. |
|
pure virtual |
Sets the rendering view port.
Lighting* kge::gfx::Renderer::Lights |
Tamame kar ba norha dar in pointer gharar darad.
Definition at line 268 of file Renderer.h.
|
protected |
Definition at line 507 of file Renderer.h.
|
protected |
Definition at line 496 of file Renderer.h.
|
protected |
Definition at line 505 of file Renderer.h.
|
protected |
Definition at line 497 of file Renderer.h.
|
protected |
Definition at line 495 of file Renderer.h.
|
protected |
rendering callbacks
Definition at line 533 of file Renderer.h.
|
protected |
Definition at line 534 of file Renderer.h.
|
protected |
Definition at line 522 of file Renderer.h.
|
protected |
Definition at line 509 of file Renderer.h.
|
protected |
Definition at line 509 of file Renderer.h.
|
protected |
Definition at line 499 of file Renderer.h.
|
protected |
Definition at line 500 of file Renderer.h.
|
protected |
Definition at line 509 of file Renderer.h.
|
protected |
Definition at line 501 of file Renderer.h.
|
protected |
Definition at line 501 of file Renderer.h.
|
protected |
Definition at line 501 of file Renderer.h.
|
protected |
Definition at line 501 of file Renderer.h.
|
protected |
Definition at line 494 of file Renderer.h.
|
protected |
Definition at line 492 of file Renderer.h.
|
protected |
Definition at line 525 of file Renderer.h.
|
protected |
Definition at line 508 of file Renderer.h.
|
protected |
Definition at line 525 of file Renderer.h.
|
protected |
Definition at line 525 of file Renderer.h.
|
protected |
Vertex declarations.
Definition at line 515 of file Renderer.h.
|
protected |
Definition at line 530 of file Renderer.h.
|
protected |
Definition at line 493 of file Renderer.h.
|
protected |
Definition at line 498 of file Renderer.h.
|
protected |
Definition at line 512 of file Renderer.h.
|
protected |
The created buffer pointers.
Definition at line 520 of file Renderer.h.
|
protected |
The created VertexDec pointers.
Definition at line 518 of file Renderer.h.