TRenderer Class Reference

This class defines renderer which encapsulates graphics device. More...

#include <RendererTypes.h>

List of all members.

Public Member Functions

virtual BOOL CreateTextureImage (DWORD width, DWORD height, DWORD levels, EnumGraphicFormat format, EnumGraphicPool pool, TRendererTextureImage **texture)=0
 Creates image texture as MANAGED or in RAM.
virtual BOOL CreateTextureImageDynamic (DWORD width, DWORD height, EnumGraphicFormat format, TRendererTextureImage **texture)=0
 Creates DYNAMIC image texture.
virtual BOOL CreateTextureImageAsRenderTarget (DWORD width, DWORD height, DWORD levels, EnumGraphicFormat format, TRendererTextureImage **texture)=0
 Creates image texture as rendertarget.
virtual BOOL CreateTextureCube (DWORD length, DWORD levels, EnumGraphicFormat format, EnumGraphicPool pool, TRendererTextureCube **texture)=0
 Creates cubemap texture as MANAGED or in RAM.
virtual BOOL CreateTextureCubeAsRenderTarget (DWORD length, DWORD levels, EnumGraphicFormat format, TRendererTextureCube **texture)=0
 Creates cubemap texture in VIDEO memory as render target.
virtual BOOL SetTexture (DWORD stage, TRendererTexture *texture)=0
 Sets texture to given texture stage.
virtual BOOL GetTexture (DWORD stage, TRendererTexture **texture)=0
 Gets texture from given texture stage.
virtual BOOL UpdateTextureImage (TRendererTextureImage *destination, const TGraphicTexture *source) const =0
 Updates entire renderer texture from software texture.
virtual BOOL UpdateTextureImageDynamic (TRendererTextureImage *destination, const TGraphicTexture *source) const =0
 Updates entire renderer dynamic texture from software texture.
virtual BOOL ReadTextureImage (TGraphicTexture *destination, TRendererTextureImage *source) const =0
 Reads data from entire renderer texture and store it in software texture.
virtual BOOL UpdateTextureCube (EnumGraphicCubemapFaces face, TRendererTextureCube *destination, const TGraphicTexture *source) const =0
 Updates specified side of cubemap with data from software texture.
virtual BOOL ReadTextureCube (EnumGraphicCubemapFaces face, TGraphicTexture *destination, TRendererTextureCube *source) const =0
 Reads data from specified side of renderer cubemap texture and store it in software texture.
virtual BOOL UpdateRenderTargetTextureImage (TRendererTextureImage *destination, TRendererTextureImage *source) const =0
 Updates entire renderer render-target texture with data from texture created in RAM pool.
virtual BOOL ReadRenderTargetTextureImage (TRendererTextureImage *destination, TRendererTextureImage *source) const =0
 Reads entire renderer render-target texture and data store into texture created in RAM pool.
virtual BOOL UpdateRenderTargetTextureCube (EnumGraphicCubemapFaces face, TRendererTextureCube *destination, TRendererTextureImage *source) const =0
 Updates one side from render-target cubemap texture with data from texture created in RAM pool.
virtual BOOL ReadRenderTargetTextureCube (EnumGraphicCubemapFaces face, TRendererTextureImage *destination, TRendererTextureCube *source) const =0
 Reads one side from render-target texture and data store into texture created in RAM pool.
virtual BOOL CreateSurfaceAsDepthStencil (DWORD width, DWORD height, EnumGraphicFormat format, TRendererSurface **surface)=0
 This method creates surface which may be used as depth-stencil buffer in renderer.
virtual BOOL CreateSurfaceAsRenderTarget (DWORD width, DWORD height, EnumGraphicFormat format, TRendererSurface **surface)=0
 This method creates surface which may be used as render-target surface in renderer.
virtual BOOL CreateSurfaceAsImage (DWORD width, DWORD height, EnumGraphicFormat format, TRendererSurface **surface)=0
 This method creates surface in system RAM which may be used as source for update operations.
virtual BOOL GetRenderTarget (TRendererSurface **surface)=0
 Gets pointer to actual render-target which is used in renderer.
virtual BOOL SetRenderTarget (TRendererSurface *surface)=0
 Sets new render-target to renderer.
virtual BOOL GetDepthStencil (TRendererSurface **surface)=0
 Gets pointer to actual depth-stencil surface which is used in renderer.
virtual BOOL SetDepthStencil (TRendererSurface *surface)=0
 Sets new depth-stencil surface to renderer.
virtual BOOL IsDepthStencilCompatible (TRendererSurface *surface) const =0
 This method only checks whether specified surface may be used as depth-stencil surface with actual render-target.
virtual BOOL IsRenderTargetCompatible (TRendererSurface *surface) const =0
 This method only checks whether specified surface may be used as render-target surface with actual depth-stencil surface.
virtual BOOL UpdateSurface (TRendererSurface *destination, const TGraphicSurface *source) const =0
 Copy data from software surface (TGraphicSurface) into renderer surface.
virtual BOOL UpdateSurfaceDynamic (TRendererSurface *destination, const TGraphicSurface *source) const =0
 Update entire dynamic surface.
virtual BOOL UpdateSurfaceRect (TRendererSurface *destination, const TGraphicSurface *source, const TRect *dest_rect, const TRect *src_rect) const =0
 Copy data from specified rectangle on software surface (TGraphicSurface) into specified rectangle renderer surface.
virtual BOOL ReadSurface (TGraphicSurface *destination, TRendererSurface *source) const =0
 Copy data from renderer surface into software surface (TGraphicSurface).
virtual BOOL ReadSurfaceRect (TGraphicSurface *destination, TRendererSurface *source, const TRect *dest_rect, const TRect *src_rect) const =0
 Copy data from specified rectangle on renderer surface into specified rectangle in software surface (TGraphicSurface).
virtual BOOL UpdateRenderTargetSurface (TRendererSurface *destination, TRendererSurface *source) const =0
 Update surface created as render-target in VIDEO memory from surface created in RAM memory.
virtual BOOL ReadRenderTargetSurface (TRendererSurface *destination, TRendererSurface *source) const =0
 Read data from surface created as render-target in VIDEO memory and save it into surface created in RAM memory.
virtual BOOL CreateVertexBuffer (DWORD vertexSize, DWORD numberVertices, BOOL isStatic, TRendererVertexBuffer **vertexBuffer)=0
 This method creates vertex buffer.
virtual BOOL CreateIndexBuffer (DWORD numberIndices, BOOL isStatic, TRendererIndexBuffer **indexBuffer)=0
 This method creates 16-bits index buffer.
virtual BOOL SetVertexBuffer (TRendererVertexBuffer *vertexBuffer)=0
 Sets new vertex buffer to renderer.
virtual BOOL SetIndexBuffer (TRendererIndexBuffer *indexBuffer)=0
 Sets new index buffer to renderer.
virtual BOOL GetVertexBuffer (TRendererVertexBuffer **vertexBuffer)=0
 Gets pointer to vertex buffer stored in renderer.
virtual BOOL GetIndexBuffer (TRendererIndexBuffer **indexBuffer)=0
 Gets pointer to index buffer stored in renderer.
virtual BOOL UpdateVertexBuffer (TRendererVertexBuffer *vertexBuffer, void *data, DWORD startVertex, DWORD vertices)=0
 Updates vertex buffer.
virtual BOOL DiscardDynamicVertexBuffer (TRendererVertexBuffer *vertexBuffer, void *data, DWORD startVertex, DWORD vertices)=0
 This method update dynamic vertex buffer thus cannot be used for static vertex buffers.
virtual BOOL AddToDynamicVertexBuffer (TRendererVertexBuffer *vertexBuffer, void *data, DWORD vertices)=0
 This method updates dynamic vertex buffer thus cannot be used for static vertex buffer.
virtual BOOL UpdateIndexBuffer (TRendererIndexBuffer *indexBuffer, void *data, DWORD startIndex, DWORD indices)=0
 Updates index buffer.
virtual BOOL DiscardDynamicIndexBuffer (TRendererIndexBuffer *indexBuffer, void *data, DWORD startIndex, DWORD indices)=0
 This method update dynamic index buffer thus cannot be used for static index buffers.
virtual BOOL AddToDynamicIndexBuffer (TRendererIndexBuffer *indexBuffer, void *data, DWORD indices)=0
 This method updates dynamic index buffer thus cannot be used for static index buffer.
virtual BOOL CreateVertexShader (const char *buffer, const DWORD &size, TRendererVertexShader **shader)=0
 Creates vertex shader from specified string of bytes which represent compiled shader in bytecode.
virtual BOOL CreatePixelShader (const char *buffer, const DWORD &size, TRendererPixelShader **shader)=0
 Creates pixel shader from specified string of bytes which represents compiled shader in bytecode.
virtual BOOL SetVertexShader (TRendererVertexShader *shader)=0
 Sets new vertex shader to renderer.
virtual BOOL SetPixelShader (TRendererPixelShader *shader)=0
 Sets new pixel shader to renderer.
virtual BOOL GetVertexShader (TRendererVertexShader **shader)=0
 Gets pointer to vertex shader stored in renderer.
virtual BOOL GetPixelShader (TRendererPixelShader **shader)=0
 Gets pointer to pixel shader stored in renderer.
virtual BOOL SetVertexShaderConstantFloat (DWORD startBank, DWORD bankCount, const float *bankArray)=0
 This method set vertex shader constants to float shader registers.
virtual BOOL SetPixelShaderConstantFloat (DWORD startBank, DWORD bankCount, const float *bankArray)=0
 This method set pixel shader constants to float shader registers.
virtual BOOL GetVertexShaderConstantFloat (DWORD startBank, DWORD bankCount, float *bankArray)=0
 This method get vertex shader constants from float shader registers.
virtual BOOL GetPixelShaderConstantFloat (DWORD startBank, DWORD bankCount, float *bankArray)=0
 This method get pixel shader constants from float shader registers.
virtual BOOL AssembleVertexShader (const char *filename, TRendererVertexShader **shader)=0
 Creates vertex shader from specified file which contains vertex shader in assembler.
virtual BOOL AssembleVertexShader (const char *data, const DWORD &dataSize, TRendererVertexShader **shader)=0
 Creates vertex shader from specified array of bytes.
virtual BOOL CompileVertexShader (const char *filename, const char *funcName, EnumGraphicVertexShaderVersion version, TRendererVertexShader **shader)=0
 Creates vertex shader from specified file which contains vertex shader in shader language.
virtual BOOL CompileVertexShader (const char *data, const DWORD &dataSize, const char *funcName, EnumGraphicVertexShaderVersion version, TRendererVertexShader **shader)=0
 Creates vertex shader from specified array of bytes which contains vertex shader in shader language.
virtual BOOL AssemblePixelShader (const char *filename, TRendererPixelShader **shader)=0
 Creates pixel shader from specified file which contains pixel shader in assembler.
virtual BOOL AssemblePixelShader (const char *data, const DWORD &dataSize, TRendererPixelShader **shader)=0
 Creates pixel shader from specified array of bytes.
virtual BOOL CompilePixelShader (const char *filename, const char *funcName, EnumGraphicPixelShaderVersion version, TRendererPixelShader **shader)=0
 Creates vertex shader from specified file which contains vertex shader in shader language.
virtual BOOL CompilePixelShader (const char *data, const DWORD &dataSize, const char *funcName, EnumGraphicPixelShaderVersion version, TRendererPixelShader **shader)=0
 Creates pixel shader from specified array of bytes which contains pixel shader in shader language.
virtual BOOL CreateVertexDeclaration (const TRendererVertexElementArray *elements, TRendererVertexDeclaration **declaration)=0
 Creates vertex declaration.
virtual BOOL SetVertexDeclaration (TRendererVertexDeclaration *declaration)=0
 Sets vertex declaration to renderer.
virtual BOOL GetVertexDeclaration (TRendererVertexDeclaration **declaration)=0
 Gets pointer to vertex declaration stored in renderer.
virtual BOOL SetRenderState (EnumGraphicRenderState state, DWORD value)=0
 This method set specified renderer state value.
virtual BOOL GetRenderState (EnumGraphicRenderState state, DWORD *value)=0
 This method get specified renderer state value.
virtual BOOL SetSamplerState (DWORD sampler, EnumGraphicSamplerState state, DWORD value)=0
 This method set specified sampler state.
virtual BOOL GetSamplerState (DWORD sampler, EnumGraphicSamplerState state, DWORD *value)=0
 This method get specified sampler state.
virtual BOOL BeginScene (void)=0
 This method begins rendering of current frame.
virtual BOOL EndScene (void)=0
 This method finishes rendering to back buffer.
virtual EnumRetValue Present (void)=0
 This method flip backbuffer to front buffer and scene is displayed at screen.
virtual BOOL Clear (BOOL renderTarget, BOOL depth, BOOL stencil, TColor colorValue, float zValue, DWORD stencilValue)=0
 This method clears actual render target, depth and stencil surface.
virtual BOOL DrawTriangleList (DWORD triangles, DWORD zeroVertex, DWORD firstIndexInIB, DWORD firstVertexIndexInVB, DWORD verticesProceeded)=0
 This method draws triangle list with using actually set VB,IB and vertex declaration.
virtual BOOL DrawTriangleStrip (DWORD triangles, DWORD zeroVertex, DWORD firstIndexInIB, DWORD firstVertexIndexInVB, DWORD verticesProceeded)=0
 This method draws triangle strip with using actually set VB,IB and vertex declaration.
virtual BOOL DrawLineList (DWORD lines, DWORD zeroVertex, DWORD firstIndexInIB, DWORD firstVertexIndexInVB, DWORD verticesProceeded)=0
 This method draws line list with using actually set VB,IB and vertex declaration.
virtual BOOL DrawLineStrip (DWORD lines, DWORD zeroVertex, DWORD firstIndexInIB, DWORD firstVertexIndexInVB, DWORD verticesProceeded)=0
 This method draws line strip with using actually set VB,IB and vertex declaration.
virtual BOOL DrawNIPointList (DWORD points, DWORD startVertex)=0
 This method renders list of points without index buffer (non-indexed rendering).
virtual BOOL DrawNITriangleList (DWORD triangles, DWORD startVertex)=0
 This method renders list of triangles without index buffer (non-indexed rendering).
virtual BOOL DrawNITriangleStrip (DWORD triangles, DWORD startVertex)=0
 This method renders strip of triangles without index buffer (non-indexed rendering).
virtual BOOL DrawNILineList (DWORD lines, DWORD startVertex)=0
 This method renders list of lines without index buffer (non-indexed rendering).
virtual BOOL DrawNILineStrip (DWORD lines, DWORD startVertex)=0
 This method renders strip of lines without index buffer (non-indexed rendering).
virtual BOOL IsFormatCompressed (EnumGraphicFormat format) const =0
 Determines whether specified renderer format is compressed.
virtual DWORD GetFormatBlockSize (EnumGraphicFormat format) const =0
 Returns size of compressed format's block.
virtual DWORD GetWidth (void) const =0
 Returns resolution width.
virtual DWORD GetHeight (void) const =0
 Returns resolution height.
virtual DWORD GetRefreshRate (void) const =0
 Returns display refresh rate.
virtual BOOL EvictManagedResources (void)=0
 Calling this method causes all resources allocated as MANAGED will be copy to system memory thus VIDEO memory will be contains only resourcs allocated in VIDEO memory.
virtual EnumGraphicVertexShaderVersion GetVertexShaderVersion (void) const =0
 Return used vertex shader version.
virtual EnumGraphicPixelShaderVersion GetPixelShaderVersion (void) const =0
 Return used pixel shader version.
virtual DWORD GetVertexShaderRegisterBanks (void) const =0
 Return number of vertex shader float constant registers.
virtual DWORD GetPixelShaderRegisterBanks (void) const =0
 Return number of pixel shader float constant registers.
virtual DWORD GetSamplerCount (void) const =0
 Return number of texture samplers in this device.
virtual const TRendererCapsGetCaps (void) const =0
 Return pointer to structure with information about device capabilites.
virtual DWORD GetVertexBufferCount (void) const =0
 This method returns number of allocated vertex buffer.
virtual DWORD GetIndexBufferCount (void) const =0
 This method returns number of allocated index buffer.
virtual DWORD GetTexturesCount (void) const =0
 This method returns number of allocated textures.
virtual DWORD GetSurfacesCount (void) const =0
 This method returns number of allocated surfaces.
virtual DWORD GetVertexShaderCount (void) const =0
 This method returns number of allocated vertex shaders.
virtual DWORD GetPixelShaderCount (void) const =0
 This method returns number of allocated pixel shaders.
virtual DWORD GetDeclarationsCount (void) const =0
 This method returns number of allocated vertex declarations.
virtual DWORD GetVideoResources (void) const =0
 This method returns number of resources allocated in VIDEO memory.
virtual DWORD GetManagedResources (void) const =0
 This method returns number of resources allocated in MANAGED memory.
virtual DWORD GetRAMResources (void) const =0
 This method returns number o resources allocated in RAM memory.
virtual EnumRendererType GetRendererType (void) const =0
 Returns type of renderer.
virtual EnumRetValue Reset (void)=0
 This method resets renderer from lost state into operational state.
virtual EnumRetValue ChangeResolution (DWORD width, DWORD height, DWORD refreshRate, BOOL window)=0
 Change renderer display mode.
virtual EnumRetValue SwapWindowMode (void)=0
 Change from fullscreen to window mode and vice versa.
virtual BOOL IsFullscreen (void) const =0
 Determines whether application runs in fullscreen.
virtual EnumRetValue GetState (void)=0
 Returns renderer status.
virtual BOOL IsDebugMode (void) const =0
 Determines whether render is in DEBUG mode.
virtual BOOL IsRetailMode (void) const =0
 Determines whether render is in RETAIL mode.
virtual BOOL Release (BOOL force=FALSE)=0
 This method releases renderer if no resources are already allocated.


Detailed Description

This class defines renderer which encapsulates graphics device.

This class is pure virtual.

TRenderer object may be created only via TRendererCreator object. Each TRendererCreator object may create only one TRenderer object and may be destroyed only after this TRenderer object is destroyed.

Definition at line 1660 of file RendererTypes.h.


Member Function Documentation

virtual BOOL TRenderer::AddToDynamicIndexBuffer TRendererIndexBuffer indexBuffer,
void *  data,
DWORD  indices
[pure virtual]
 

This method updates dynamic index buffer thus cannot be used for static index buffer.

Method adds data after last valid index in IB, but there must be enough space (see TRendererIndexBuffer::GetFreeCapacity()). If there isn't enough space for vertices then FASLE is returned. In this case you should add data to index buffer via calling TRendererIndexBuffer::DiscardDynamicIndexBuffer(), but be carefull, this method destroys previous data in index buffer!!!

Parameters:
indexBuffer [in,out] index buffer - must be dynamic - see TRendererIndexBuffer::IsDynamic()
data [in] pointer to new vertex data
indices [in] number of indices to store - see TRendererIndexBuffer::GetIndexSize() for information about index size.

virtual BOOL TRenderer::AddToDynamicVertexBuffer TRendererVertexBuffer vertexBuffer,
void *  data,
DWORD  vertices
[pure virtual]
 

This method updates dynamic vertex buffer thus cannot be used for static vertex buffer.

Method adds data after last valid vertex in VB, but there must be enough space (see TRendererVertexBuffer::GetFreeCapacity()). If there isn't enough space for vertices then FASLE is returned. In this case you should add data to vertex buffer via calling TRendererVertexBuffer::DiscardDynamicVertexBuffer(), but be carefull, this method destroys previous data in vertex buffer.

Parameters:
vertexBuffer [in,out] vertex buffer - must be dynamic - see TRendererVertexBuffer::IsDynamic()
data [in] pointer to new vertex data
vertices [in] number of vertices to store - see TRendererVertexBuffer::GetVertexSize() for information about vertex size.

virtual BOOL TRenderer::AssemblePixelShader const char *  data,
const DWORD dataSize,
TRendererPixelShader **  shader
[pure virtual]
 

Creates pixel shader from specified array of bytes.

This array contains pixel shader in assembler load from file or resource.

Parameters:
data [in] pointer to array with shader in assembler
dataSize [in] size of data in bytes
shader [out] address of pointer where result will be stored

virtual BOOL TRenderer::AssemblePixelShader const char *  filename,
TRendererPixelShader **  shader
[pure virtual]
 

Creates pixel shader from specified file which contains pixel shader in assembler.

Parameters:
filename [in] name of file with pixel shader
shader [out] address of pointer where result will be stored

virtual BOOL TRenderer::AssembleVertexShader const char *  data,
const DWORD dataSize,
TRendererVertexShader **  shader
[pure virtual]
 

Creates vertex shader from specified array of bytes.

This array contains vertex shader in assembler load from file or resource.

Parameters:
data [in] pointer to array with shader in assembler
dataSize [in] size of data in bytes
shader [out] address of pointer where result will be stored

virtual BOOL TRenderer::AssembleVertexShader const char *  filename,
TRendererVertexShader **  shader
[pure virtual]
 

Creates vertex shader from specified file which contains vertex shader in assembler.

Parameters:
filename [in] name of file with vertex shader
shader [out] address of pointer where result will be stored

virtual BOOL TRenderer::BeginScene void   )  [pure virtual]
 

This method begins rendering of current frame.

In one frame should be only one calling of this type. Rendering is finished by calling EndScene() and presented to front buffer with Present(). In block BeginScene() and EndScene() you can change render targets for rendering to textures etc. thus no more than one this block is required This method always returns valid values - in DEBUG and RETAIL mode.

Return values:
TRUE method calling was successfull
FALSE method fails

virtual EnumRetValue TRenderer::ChangeResolution DWORD  width,
DWORD  height,
DWORD  refreshRate,
BOOL  window
[pure virtual]
 

Change renderer display mode.

Before calling this method all resources created in VIDEO memory must be released. This method always returns valid values.

Parameters:
width [in] width in pixels
height [in] height in pixels
refreshRate [in] new refresh rate of display (must)
window [in] determines whether after calling this method application runs in window or in fullscreen
Return values:
GRAPH_RET_ERROR critical error
GRAPH_RET_UNSUPPORTEDMODE unsupported display mode
GRAPH_RET_ALLOCRESOURCES resources in VIDEO memory are still allocated

virtual BOOL TRenderer::Clear BOOL  renderTarget,
BOOL  depth,
BOOL  stencil,
TColor  colorValue,
float  zValue,
DWORD  stencilValue
[pure virtual]
 

This method clears actual render target, depth and stencil surface.

It's good habit clear all surfaces together, especially depth and stencil, which are stored together on today graphic hardware. Method should clear only these surface which are created, if method clears nonxistent surface error may occured. This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
renderTarget [in] determines whether render target will be cleared
depth [in] determines whether depth buffer will be cleared
stencil [in] determines whether stencil buffer will be cleared
colorValue [in] color used to clear render target
zValue [in] value used to fill depth buffer (must be in range <0.f,1.f>)
stencilValue [in] value used to fill stencil buffer (must be in range <0,2^n - 1>, where n is number of bits in stencil buffer)
Return values:
TRUE method calling was successfull
FALSE method fails

Referenced by MainLoop().

virtual BOOL TRenderer::CompilePixelShader const char *  data,
const DWORD dataSize,
const char *  funcName,
EnumGraphicPixelShaderVersion  version,
TRendererPixelShader **  shader
[pure virtual]
 

Creates pixel shader from specified array of bytes which contains pixel shader in shader language.

For this renderer shader language must be HLSL.

Parameters:
data [in] array with shader in shader language
dataSize [in] size of data in array
funcName [in] name of input function in shader file
version [in] version of VS which may be used for compiling this shader
shader [out] address of pointer where result will be stored

virtual BOOL TRenderer::CompilePixelShader const char *  filename,
const char *  funcName,
EnumGraphicPixelShaderVersion  version,
TRendererPixelShader **  shader
[pure virtual]
 

Creates vertex shader from specified file which contains vertex shader in shader language.

For this renderer shder language must be HLSL.

Parameters:
filename [in] name of file with vertex shader
funcName [in] name of input function in shader file
version [in] version of VS which may be used for compiling this shader
shader [out] address of pointer where result will be stored

virtual BOOL TRenderer::CompileVertexShader const char *  data,
const DWORD dataSize,
const char *  funcName,
EnumGraphicVertexShaderVersion  version,
TRendererVertexShader **  shader
[pure virtual]
 

Creates vertex shader from specified array of bytes which contains vertex shader in shader language.

For this renderer shader language must be HLSL.

Parameters:
data [in] array with shader
dataSize [in] size of array in bytes
funcName [in] name of input function in shader file
version [in] version of VS which may be used for compiling this shader
shader [out] address of pointer where result will be stored

virtual BOOL TRenderer::CompileVertexShader const char *  filename,
const char *  funcName,
EnumGraphicVertexShaderVersion  version,
TRendererVertexShader **  shader
[pure virtual]
 

Creates vertex shader from specified file which contains vertex shader in shader language.

For this renderer shder language must be HLSL.

Parameters:
filename [in] name of file with vertex shader
funcName [in] name of input function in shader file
version [in] version of VS which may be used for compiling this shader
shader [out] address of pointer where result will be stored

virtual BOOL TRenderer::CreateIndexBuffer DWORD  numberIndices,
BOOL  isStatic,
TRendererIndexBuffer **  indexBuffer
[pure virtual]
 

This method creates 16-bits index buffer.

All index buffers are created in VIDEO memory and are write-only. When renderer is lost then application must restore contents of index buffer!!! Application also may create dynamic index buffer which may be useful for dynamic data. This method always returns valid values - IN DEBUG and RETAIL mode.

Parameters:
numberIndices [in] number of indices in buffer
isStatic [in] determines whether this index buffer will be static or dynamic
indexBuffer [out] adress of pointer to store result - if method fails NULL is set to pointer
Return values:
TRUE index buffer was created successfully
FALSE creation failed

virtual BOOL TRenderer::CreatePixelShader const char *  buffer,
const DWORD size,
TRendererPixelShader **  shader
[pure virtual]
 

Creates pixel shader from specified string of bytes which represents compiled shader in bytecode.

This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
buffer [in] buffer contains shader bytecode
size [in] size of buffer in bytes
shader [out] address of pointer to store result
Return values:
TRUE vertex shader was successfully created
FALSE method fails

virtual BOOL TRenderer::CreateSurfaceAsDepthStencil DWORD  width,
DWORD  height,
EnumGraphicFormat  format,
TRendererSurface **  surface
[pure virtual]
 

This method creates surface which may be used as depth-stencil buffer in renderer.

Depth-stencil surfaces are always create in VIDEO memory and NEVER are lockable and there is no way how to read data from depth-stencil surface. Depth-stencil surface size needn't be square. This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
width [in] width of surface
height [in] height of surface
format [in] format of surface - must be compatible with depthstencil (see TRendererCaps::CheckDepthStencilFormat)
surface [out] adress of pointer to store result - if method fails NULL is set to pointer
Return values:
TRUE surface was created successfully
FALSE any error

virtual BOOL TRenderer::CreateSurfaceAsImage DWORD  width,
DWORD  height,
EnumGraphicFormat  format,
TRendererSurface **  surface
[pure virtual]
 

This method creates surface in system RAM which may be used as source for update operations.

This type of surface is ALWAYS lockable. This surface can create only format compatible with texture format (no render targets or depth-stencil formats)

This surface may have arbitrary dimensions but compressed formats must be power of 2 (most often compressed formats are not supported for plain surface - see CheckSurfaceFormat() in TRendererCaps structure) This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
width [in] width of surface
height [in] height of surface
format [in] format of surface - must be compatible with plain surface format (see TRendererCaps::CheckSurfaceFormat)
surface [out] adress of pointer to store result - if method fails NULL is set to pointer
Return values:
TRUE surface was created successfully
FALSE any error

virtual BOOL TRenderer::CreateSurfaceAsRenderTarget DWORD  width,
DWORD  height,
EnumGraphicFormat  format,
TRendererSurface **  surface
[pure virtual]
 

This method creates surface which may be used as render-target surface in renderer.

Depth-stencil surfaces are always create in VIDEO memory and NEVER are lockable. Compressed formats cannot be never used as render-target! This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
width [in] width of surface
height [in] height of surface
format [in] format of surface - must be compatible with rendertarget (see TRendererCaps::CheckRTFormat)
surface [out] adress of pointer to store result - if method fails NULL is set to pointer
Return values:
TRUE surface was created successfully
FALSE any error

virtual BOOL TRenderer::CreateTextureCube DWORD  length,
DWORD  levels,
EnumGraphicFormat  format,
EnumGraphicPool  pool,
TRendererTextureCube **  texture
[pure virtual]
 

Creates cubemap texture as MANAGED or in RAM.

This method cannot create texture in VIDEO memory! Thus textures created by this method are ALWAYS lockable. Texture dimensions must be equal to power of two! This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
length [in] length of all edges of top-level faces in cubemap
levels [in] number of levels in all faces (not all level will be created if levels parameter is too large, last mipmap is always of size 1x1)
format [in] format of surfaces inside cubemap - must be compatible with texture format (see TRendererCaps::CheckCubeTextureFormat)
pool [in] pool where texture will be created, may be MANAGED(renderable) or RAM(non-renderable)
texture [out] adress of pointer to store result - if methods fails NULL is set to pointer
Return values:
TRUE texture was created successfully
FALSE texture creation fail

virtual BOOL TRenderer::CreateTextureCubeAsRenderTarget DWORD  length,
DWORD  levels,
EnumGraphicFormat  format,
TRendererTextureCube **  texture
[pure virtual]
 

Creates cubemap texture in VIDEO memory as render target.

Format must be compatible with render target. Thus textures created by this method are NEVER lockable. This methods always returns valid values - in DEBUG and RETAIL mode.

Parameters:
length [in] length of all edges of top-level faces in cubemap
levels [in] number of levels in all faces (not all level will be created if levels parameter is too large, last mipmap is always of size 1x1)
format [in] format of surfaces inside cubemap - must be compatible with rendertarget (see TRendererCaps::CheckCubeTextureFormatAsRT)
texture [out] adress of pointer to store result - if methods fails NULL is set to pointer
Return values:
TRUE texture was created successfully
FALSE texture creation fail

virtual BOOL TRenderer::CreateTextureImage DWORD  width,
DWORD  height,
DWORD  levels,
EnumGraphicFormat  format,
EnumGraphicPool  pool,
TRendererTextureImage **  texture
[pure virtual]
 

Creates image texture as MANAGED or in RAM.

This method cannot create texture in VIDEO memory! Thus textures created by this method are ALWAYS lockable.

All texture formats must have dimension power of 2, but needn't be square (for example 512x256 is valid). This methods return valid values in DEBUG and RETAIL mode!

Parameters:
width [in] width of top-level surface in texture
height [in] height of top-level surface in texture
levels [in] number of levels in all faces, 0 means all possible levels will be generated (not all level will be created if levels parameter is too large, last mipmap is always of size 1x1)
format [in] format of surfaces inside texture - must be compatible with texture format (see TRendererCaps::CheckTextureFormat)
pool [in] pool where texture will be created, may be MANAGED(renderable) or RAM(non-renderable)
texture [out] adress of pointer to store result - if methods fails NULL is set to pointer
Return values:
TRUE texture was created successfully
FALSE texture creation fail

virtual BOOL TRenderer::CreateTextureImageAsRenderTarget DWORD  width,
DWORD  height,
DWORD  levels,
EnumGraphicFormat  format,
TRendererTextureImage **  texture
[pure virtual]
 

Creates image texture as rendertarget.

This method create texture always in VIDEO memory! Thus textures created by this method are NEVER lockable. Texture dimensions must be equal to power of two! This method returns always valid values in toth modes - DEBUG and RETAIL.

Parameters:
width [in] width of top-level surface in texture
height [in] height of top-level surface in texture
levels [in] number of levels in all faces (not all level will be created if levels parameter is too large, last mipmap is always of size 1x1)
format [in] format of surfaces inside texture - must be compatible with rendertarget format (see TRendererCaps::CheckTextureFormatAsRT)
texture [out] adress of pointer to store result - if methods fails NULL is set to pointer
Return values:
TRUE texture was created successfully
FALSE texture creation fail

virtual BOOL TRenderer::CreateTextureImageDynamic DWORD  width,
DWORD  height,
EnumGraphicFormat  format,
TRendererTextureImage **  texture
[pure virtual]
 

Creates DYNAMIC image texture.

This texture is always created in VIDEO pool and has only one surface Thus textures created by this method are ALWAYS lockable.

All texture formats must have dimension power of 2, but needn't be square (for example 512x256 is valid). This methods return valid values in DEBUG and RETAIL mode!

Parameters:
width [in] width of top-level surface in texture
height [in] height of top-level surface in texture
format [in] format of surfaces inside texture - must be compatible with texture format (see TRendererCaps::CheckTextureFormat)
texture [out] adress of pointer to store result - if methods fails NULL is set to pointer
Return values:
TRUE texture was created successfully
FALSE texture creation fail

virtual BOOL TRenderer::CreateVertexBuffer DWORD  vertexSize,
DWORD  numberVertices,
BOOL  isStatic,
TRendererVertexBuffer **  vertexBuffer
[pure virtual]
 

This method creates vertex buffer.

All vertex buffers are created in VIDEO memory and are write-only. When renderer is lost then application must restore contents of vertex buffer!!! Application also may create dynamic vertex buffer which may be useful for dynamic data. This method always returns valid values - IN DEBUG and RETAIL mode.

Parameters:
vertexSize [in] size of one vertex in buffer
numberVertices [in] number of vertices in buffer - maximum number of vertices is determined by TRendererVertexBuffer::MAX_VERTICES constant
isStatic [in] determines whether this vertex buffer will be static or dynamic
vertexBuffer [out] address of pointer to store result - if method fails NULL is set to pointer
Return values:
TRUE vertex buffer was created successfully
FALSE creation failed

virtual BOOL TRenderer::CreateVertexDeclaration const TRendererVertexElementArray elements,
TRendererVertexDeclaration **  declaration
[pure virtual]
 

Creates vertex declaration.

This method always return valid values - in DEBUG and RETAIN mode.

Parameters:
elements [in] array with vertex elements description (last item in array should be usage set to END, but it isn't forced)
declaration [out] address of pointer to store result
Return values:
TRUE method calling was successfull
FALSE method fails

virtual BOOL TRenderer::CreateVertexShader const char *  buffer,
const DWORD size,
TRendererVertexShader **  shader
[pure virtual]
 

Creates vertex shader from specified string of bytes which represent compiled shader in bytecode.

This method always return valid values - in DEBUG and RETAIL mode.

Parameters:
buffer [in] buffer contains shader bytecode.
size [in] size of buffer in bytes
shader [out] address of pointer to store result
Return values:
TRUE vertex shader was successfully created
FALSE method fails

virtual BOOL TRenderer::DiscardDynamicIndexBuffer TRendererIndexBuffer indexBuffer,
void *  data,
DWORD  startIndex,
DWORD  indices
[pure virtual]
 

This method update dynamic index buffer thus cannot be used for static index buffers.

After calling this method previous data in buffer are destroyed, but this method doesnt wait for device, thus device can render from previous index buffer and method copy data to new allocated buffer, which replace old buffer after rendering operation. It's good idea set STARTINDEX to 0 and INDICES to TRendererIndexxBuffer::GetCapacity(), but at this moment DATA must contain enough data bytes. If STARTINDEX or INDICES parameter do not cover entire buffer then there will be undefined areas in index buffer. Last valid index (method TRendererIndexBuffer::GetIndicesCount()) is set always to (startIndexx+indices).

Parameters:
indexBuffer [in,out] index buffer - must be dynamic - see TRendererIndexBuffer::IsDynamic()
data [in] pointer to new index data
startIndex [in] zero-based index of first index where data will be stored - see TRendererVertexBuffer::GetIndexSize() for information about index size.
indices [in] number of indices to store - see TRendererIndexBuffer::GetIndexSize() for information about index size.

virtual BOOL TRenderer::DiscardDynamicVertexBuffer TRendererVertexBuffer vertexBuffer,
void *  data,
DWORD  startVertex,
DWORD  vertices
[pure virtual]
 

This method update dynamic vertex buffer thus cannot be used for static vertex buffers.

After calling this method previous data in buffer are destroyed, but this method doesnt wait for device, thus device can render from previous vertex buffer and method copy data to new allocated buffer, which replace old buffer after rendering operation. It's good idea set STARTVERTEX to 0 and VERTICES to TRendererVertexBuffer::GetCapacity(), but at this moment DATA must contain enough data bytes. If STARTVERTEX or VERTICES parameter do not cover entire buffer then there will be undefined areas in vertex buffer. Last valid vertex (method TRendererVertexBuffer::GetVerticesCount()) is set always to (startVertex+vertices).

Parameters:
vertexBuffer [in,out] vertex buffer - must be dynamic - see TRendererVertexBuffer::IsDynamic()
data [in] pointer to new vertex data
startVertex [in] zero-based index of first vertex where data will be stored - see TRendererVertexBuffer::GetVertexSize() for information about vertex size.
vertices [in] number of vertices to store - see TRendererVertexBuffer::GetVertexSize() for information about vertex size.

virtual BOOL TRenderer::DrawLineList DWORD  lines,
DWORD  zeroVertex,
DWORD  firstIndexInIB,
DWORD  firstVertexIndexInVB,
DWORD  verticesProceeded
[pure virtual]
 

This method draws line list with using actually set VB,IB and vertex declaration.

If VB,IB or vertex declaration are not presented, then error occurs. This method returns valid values only in DEBUG mode, in RETAIL mode always return TRUE

Parameters:
lines [in] number of line's segment display
zeroVertex [in] represents zero vertex in VB, this value is add to each index in IB to offset vertices in VB (standardly this is set to zero thus first veretx lies on index VB[0], if you set this to 3 then index value 2 from IB represents vertex VB[3+2])
firstIndexInIB [in] start index in IB - represents index of first index in IB which will be used (rendering is performed with indices from IB[firstIndexInIB] to IB[firstIndexInIB+lines*2 - 1])
firstVertexIndexInVB [in] first position in VB used to rendering - this position is relative to zeroVertex parameter, thus first used vertex is at position VB[zeroVertex+firstVertexIndexInVB]
verticesProceeded [in] number of proceeded vertices in VB - this value determines continuos subarray of vertices which contains all vertices needed to rendering, this array begin at VB[zeroVertex+firstVertexIndexInVB] and end at VB[zeroVertex+firstVertexIndexInVB + verticesProceeded - 1]
Return values:
TRUE method calling was successfull (always in RETAIL mode)
FALSE method fails

virtual BOOL TRenderer::DrawLineStrip DWORD  lines,
DWORD  zeroVertex,
DWORD  firstIndexInIB,
DWORD  firstVertexIndexInVB,
DWORD  verticesProceeded
[pure virtual]
 

This method draws line strip with using actually set VB,IB and vertex declaration.

If VB,IB or vertex declaration are not presented, then error occurs. This method returns valid values only in DEBUG mode, in RETAIL mode always return TRUE

Parameters:
lines [in] number of line's segment to display
zeroVertex [in] represents zero vertex in VB, this value is add to each index in IB to offset vertices in VB (standardly this is set to zero thus first veretx lies on index VB[0], if you set this to 3 then index value 2 from IB represents vertex VB[3+2])
firstIndexInIB [in] start index in IB - represents index of first index in IB which will be used (rendering is performed with indices from IB[firstIndexInIB] to IB[firstIndexInIB+lines* - 1])
firstVertexIndexInVB [in] first position in VB used to rendering - this position is relative to zeroVertex parameter, thus first used vertex is at position VB[zeroVertex+firstVertexIndexInVB]
verticesProceeded [in] number of proceeded vertices in VB - this value determines continuos subarray of vertices which contains all vertices needed to rendering, this array begin at VB[zeroVertex+firstVertexIndexInVB] and end at VB[zeroVertex+firstVertexIndexInVB + verticesProceeded - 1]
Return values:
TRUE method calling was successfull (always in RETAIL mode)
FALSE method fails

virtual BOOL TRenderer::DrawNILineList DWORD  lines,
DWORD  startVertex
[pure virtual]
 

This method renders list of lines without index buffer (non-indexed rendering).

Parameters:
lines number of lines to render
startVertex index of first vertex to render

virtual BOOL TRenderer::DrawNILineStrip DWORD  lines,
DWORD  startVertex
[pure virtual]
 

This method renders strip of lines without index buffer (non-indexed rendering).

Parameters:
lines number of lines to render
startVertex index of first vertex to render

virtual BOOL TRenderer::DrawNIPointList DWORD  points,
DWORD  startVertex
[pure virtual]
 

This method renders list of points without index buffer (non-indexed rendering).

Parameters:
points number of points to render
startVertex index of first vertex to render

virtual BOOL TRenderer::DrawNITriangleList DWORD  triangles,
DWORD  startVertex
[pure virtual]
 

This method renders list of triangles without index buffer (non-indexed rendering).

Parameters:
triangles number of triangles to render
startVertex index of first vertex to render

virtual BOOL TRenderer::DrawNITriangleStrip DWORD  triangles,
DWORD  startVertex
[pure virtual]
 

This method renders strip of triangles without index buffer (non-indexed rendering).

Parameters:
triangles number of triangles to render
startVertex index of first vertex to render

virtual BOOL TRenderer::DrawTriangleList DWORD  triangles,
DWORD  zeroVertex,
DWORD  firstIndexInIB,
DWORD  firstVertexIndexInVB,
DWORD  verticesProceeded
[pure virtual]
 

This method draws triangle list with using actually set VB,IB and vertex declaration.

If VB,IB or vertex declaration are not presented, then error occurs. This method returns valid values only in DEBUG mode, in RETAIL mode always return TRUE

Parameters:
triangles [in] number of triangles to display
zeroVertex [in] represents zero vertex in VB, this value is add to each index in IB to offset vertices in VB (standardly this is set to zero thus first veretx lies on index VB[0], if you set this to 3 then index value 2 from IB represents vertex VB[3+2])
firstIndexInIB [in] start index in IB - represents index of first index in IB which will be used (rendering is performed with indices from IB[firstIndexInIB] to IB[firstIndexInIB+triangles*3 - 1])
firstVertexIndexInVB [in] first position in VB used to rendering - this position is relative to zeroVertex parameter, thus first used vertex is at position VB[zeroVertex+firstVertexIndexInVB]
verticesProceeded [in] number of proceeded vertices in VB - this value determines continuos subarray of vertices which contains all vertices needed to rendering, this array begin at VB[zeroVertex+firstVertexIndexInVB] and end at VB[zeroVertex+firstVertexIndexInVB + verticesProceeded - 1]
Return values:
TRUE method calling was successfull (always in RETAIL mode)
FALSE method fails

virtual BOOL TRenderer::DrawTriangleStrip DWORD  triangles,
DWORD  zeroVertex,
DWORD  firstIndexInIB,
DWORD  firstVertexIndexInVB,
DWORD  verticesProceeded
[pure virtual]
 

This method draws triangle strip with using actually set VB,IB and vertex declaration.

If VB,IB or vertex declaration are not presented, then error occurs. This method returns valid values only in DEBUG mode, in RETAIL mode always return TRUE

Parameters:
triangles [in] number of triangles to display
zeroVertex [in] represents zero vertex in VB, this value is add to each index in IB to offset vertices in VB (standardly this is set to zero thus first veretx lies on index VB[0], if you set this to 3 then index value 2 from IB represents vertex VB[3+2])
firstIndexInIB [in] start index in IB - represents index of first index in IB which will be used (rendering is performed with indices from IB[firstIndexInIB] to IB[firstIndexInIB+triangles + 2 - 1])
firstVertexIndexInVB [in] first position in VB used to rendering - this position is relative to zeroVertex parameter, thus first used vertex is at position VB[zeroVertex+firstVertexIndexInVB]
verticesProceeded [in] number of proceeded vertices in VB - this value determines continuos subarray of vertices which contains all vertices needed to rendering, this array begin at VB[zeroVertex+firstVertexIndexInVB] and end at VB[zeroVertex+firstVertexIndexInVB + verticesProceeded - 1]
Return values:
TRUE method calling was successfull (always in RETAIL mode)
FALSE method fails

virtual BOOL TRenderer::EndScene void   )  [pure virtual]
 

This method finishes rendering to back buffer.

It must be called only after successfull calling BeginScene(). This method always returns valid values - in DEBUG and RETAIL mode.

Return values:
TRUE method calling was successfull
FALSE method fails

virtual BOOL TRenderer::EvictManagedResources void   )  [pure virtual]
 

Calling this method causes all resources allocated as MANAGED will be copy to system memory thus VIDEO memory will be contains only resourcs allocated in VIDEO memory.

Thus is useful for correct resource-allocation strategy where VIDEO resources should be allocated first in row without fragmentation. While you allocating an resource in VIDEO memory you should call this method. Example: You have allocated some resources in VIDEO memory: VRES1,VRES2,EMPTY,EMPTY,... Now you create managed resources and at time of its first use it will be copy to VIDEO memory: VRES1,VRES2,MRES1,EMPTY,... Now you want create next VIDEO resources, but if you don't call this method memory will be like this: VRES1,VRES2,MRES1,VRES3,... If you use EvictManagedResources situation will be like this: VRES1,VRES2,VRES3,EMPTY,... // MRES1 was copy to RAM and video memory was deallocated When you use MRES1 it will be copied into VIDEO memory thus situation will look like this: VRES1,VRES2,VRES3,MRES1,...

This method always returns valid values - in DEBUG and RETAIL mode.

Return values:
TRUE method calling was successfull
FALSE critical error, renderer must be destroyed

virtual const TRendererCaps* TRenderer::GetCaps void   )  const [pure virtual]
 

Return pointer to structure with information about device capabilites.

virtual DWORD TRenderer::GetDeclarationsCount void   )  const [pure virtual]
 

This method returns number of allocated vertex declarations.

virtual BOOL TRenderer::GetDepthStencil TRendererSurface **  surface  )  [pure virtual]
 

Gets pointer to actual depth-stencil surface which is used in renderer.

Renderer must have always set depth-stencil thus if method returns FALSE then critical error occured! This method always returns valid value - in DEBUG and RETAIL mode.

Warning:
This method increase number of references to actual depth-stencil surface!
Parameters:
surface [out] adress of pointer to store result
Return values:
TRUE surface getting was successful
FALSE any error

virtual DWORD TRenderer::GetFormatBlockSize EnumGraphicFormat  format  )  const [pure virtual]
 

Returns size of compressed format's block.

For non-compressed format size of one block is always 1x1, thus returns 1. But for example DXTn formats have size of block equal to 4x4 (4 is returned). This size determines allowed dimension of created textures and surfaces and also size of locked rectangles on surfaces. For example size of DXTn surface must be multiply of 4 and format may be locked only at 4x4 boundary - for size 1x1 DXTn you must use 4x4 rect to lock too!

Parameters:
format [in] specified renderer format
Returns:
number of pixels in one block of given pixelformat (in one dimension)

virtual DWORD TRenderer::GetHeight void   )  const [pure virtual]
 

Returns resolution height.

virtual BOOL TRenderer::GetIndexBuffer TRendererIndexBuffer **  indexBuffer  )  [pure virtual]
 

Gets pointer to index buffer stored in renderer.

This method automatically increase number of references to returned index buffer. This method always return TRUE in RETAIL mode, in DEBUG mode FALSE is returned if address of pointer is invalid

Warning:
Renderer needn't have index buffer set (is set to NULL)!!!
Parameters:
indexBuffer [out] address of pointer to store result
Return values:
TRUE always in RETAIL mode, in DEBUG mode if method was successful
FALSE only in DEBUG mode if parameter is invalid

virtual DWORD TRenderer::GetIndexBufferCount void   )  const [pure virtual]
 

This method returns number of allocated index buffer.

virtual DWORD TRenderer::GetManagedResources void   )  const [pure virtual]
 

This method returns number of resources allocated in MANAGED memory.

virtual BOOL TRenderer::GetPixelShader TRendererPixelShader **  shader  )  [pure virtual]
 

Gets pointer to pixel shader stored in renderer.

This method automatically increase number of references to returned pixel shader. This method always returns valid values - in DEBUG and RETAIL mode.

Warning:
Renderer needn't have pixel shader set (is set to NULL)!!!
Parameters:
shader [out] address of pointer to store result
Return values:
TRUE pixel shader was successfully obtained
FALSE method fails

virtual BOOL TRenderer::GetPixelShaderConstantFloat DWORD  startBank,
DWORD  bankCount,
float *  bankArray
[pure virtual]
 

This method get pixel shader constants from float shader registers.

Shader registers are organised into banks, where each bank contains four float values. You must get constant registers in entire banks, thus array bankArray must have size multiple of 4. See GetPixelShaderRegisterBanks() method. This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
startBank [in] index of first bank where will be stored shader constants
bankCount [in] number of banks in bankArray
bankArray [out] array with banks
Return values:
TRUE constants was obtained successfully
FALSE method fails

virtual DWORD TRenderer::GetPixelShaderCount void   )  const [pure virtual]
 

This method returns number of allocated pixel shaders.

virtual DWORD TRenderer::GetPixelShaderRegisterBanks void   )  const [pure virtual]
 

Return number of pixel shader float constant registers.

virtual EnumGraphicPixelShaderVersion TRenderer::GetPixelShaderVersion void   )  const [pure virtual]
 

Return used pixel shader version.

virtual DWORD TRenderer::GetRAMResources void   )  const [pure virtual]
 

This method returns number o resources allocated in RAM memory.

virtual DWORD TRenderer::GetRefreshRate void   )  const [pure virtual]
 

Returns display refresh rate.

virtual EnumRendererType TRenderer::GetRendererType void   )  const [pure virtual]
 

Returns type of renderer.

virtual BOOL TRenderer::GetRenderState EnumGraphicRenderState  state,
DWORD value
[pure virtual]
 

This method get specified renderer state value.

For information about state types and their values see EnumGraphicRenderState. This method always returns TRUE in DEBUG and RETAIL mode.

Parameters:
state [in] state to get
value [out] address of state value to get where store result
Return values:
TRUE this method always returns TRUE value

virtual BOOL TRenderer::GetRenderTarget TRendererSurface **  surface  )  [pure virtual]
 

Gets pointer to actual render-target which is used in renderer.

Renderer must have always set render-target thus if method returns FALSE then critical error occured! This method always returns valid value - in DEBUG and RETAIL mode.

Warning:
This method increase number of references to actual render-target surface!
Parameters:
surface [out] adress of pointer to store result
Return values:
TRUE surface getting was successful
FALSE any error

virtual DWORD TRenderer::GetSamplerCount void   )  const [pure virtual]
 

Return number of texture samplers in this device.

virtual BOOL TRenderer::GetSamplerState DWORD  sampler,
EnumGraphicSamplerState  state,
DWORD value
[pure virtual]
 

This method get specified sampler state.

For information about sampler state types and their values see EnumGraphicSamplerState. This method returns valid values only in DEBUG mode, in RETAIL mode always returns TRUE.

Parameters:
sampler [in] sampler index
state [in] state to get - see EnumGraphicSamplerState type
value [out] address of variable to store result - value type is according to EnumGraphicSamplerState
Return values:
TRUE method calling was successfull (always in RETAIL mode)
FALSE method fails (it means always bad sampler index)

virtual EnumRetValue TRenderer::GetState void   )  [pure virtual]
 

Returns renderer status.

Calling this method may determine if renderer is lost or if is prepared for reset or rendering.

Return values:
GRAPH_RET_ERROR critical error, renderer must be destroyed
GRAPH_RET_OK renderer is prepared for rendering
GRAPH_RET_DEVICELOST renderer was lost, must be reset
GRAPH_RET_DEVICENOTRESET renderer cannot renderer, but is prepared for reset

virtual DWORD TRenderer::GetSurfacesCount void   )  const [pure virtual]
 

This method returns number of allocated surfaces.

virtual BOOL TRenderer::GetTexture DWORD  stage,
TRendererTexture **  texture
[pure virtual]
 

Gets texture from given texture stage.

See GetTextureStagesCount(). This method increase number of references to texture. If given stage has no set texture then NULL is returned.

This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
stage [in] zero-based stage index
texture [out] adress of pointer to store texture (this texture must be renderable)
Return values:
TRUE pointer to texture was get successfully
FALSE error - probably bad texture stage index

virtual DWORD TRenderer::GetTexturesCount void   )  const [pure virtual]
 

This method returns number of allocated textures.

virtual BOOL TRenderer::GetVertexBuffer TRendererVertexBuffer **  vertexBuffer  )  [pure virtual]
 

Gets pointer to vertex buffer stored in renderer.

This method automatically increase number of references to returned vertex buffer. This method always return TRUE in RETAIL mode, in DEBUG mode FALSE is returned if address of pointer is invalid

Warning:
Renderer needn't have vertex buffer set (is set to NULL)!!!
Parameters:
vertexBuffer [out] address of pointer to store result
Return values:
TRUE always in RETAIL mode, in DEBUG mode if method was successful
FALSE only in DEBUG mode if parameter is invalid

virtual DWORD TRenderer::GetVertexBufferCount void   )  const [pure virtual]
 

This method returns number of allocated vertex buffer.

virtual BOOL TRenderer::GetVertexDeclaration TRendererVertexDeclaration **  declaration  )  [pure virtual]
 

Gets pointer to vertex declaration stored in renderer.

This method automatically increase number of references to returned vertex declaration. This method always return valid values - in DEBUG and RETAIN mode.

Warning:
Renderer needn't have vertex declaration set (is set to NULL)!!!
Parameters:
declaration [out] address of pointer to store result
Return values:
TRUE method calling was successfull
FALSE method fails

virtual BOOL TRenderer::GetVertexShader TRendererVertexShader **  shader  )  [pure virtual]
 

Gets pointer to vertex shader stored in renderer.

This method automatically increase number of references to returned vertex shader. This method always returns valid values - in DEBUG and RETAIL mode.

Warning:
Renderer needn't have vertex shader set (is set to NULL)!!!
Parameters:
shader [out] address of pointer to store result
Return values:
TRUE vertex shader was successfully obtained
FALSE method fails

virtual BOOL TRenderer::GetVertexShaderConstantFloat DWORD  startBank,
DWORD  bankCount,
float *  bankArray
[pure virtual]
 

This method get vertex shader constants from float shader registers.

Shader registers are organised into banks, where each bank contains four float values. You must get constant registers in entire banks, thus array bankArray must have size multiple of 4. See GetVertexShaderRegisterBanks() method. This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
startBank [in] index of first bank where will be read shader constants
bankCount [in] number of banks in bankArray
bankArray [out] array with banks
Return values:
TRUE constants was obtained successfully
FALSE method fails

virtual DWORD TRenderer::GetVertexShaderCount void   )  const [pure virtual]
 

This method returns number of allocated vertex shaders.

virtual DWORD TRenderer::GetVertexShaderRegisterBanks void   )  const [pure virtual]
 

Return number of vertex shader float constant registers.

virtual EnumGraphicVertexShaderVersion TRenderer::GetVertexShaderVersion void   )  const [pure virtual]
 

Return used vertex shader version.

virtual DWORD TRenderer::GetVideoResources void   )  const [pure virtual]
 

This method returns number of resources allocated in VIDEO memory.

Initial value returned by this method must be 2, because there is always allocated render target and depth-stencil surface. Renderer may be reset ar resolution may be changed only if number of this is equal to 2 (no VIDEO resources allocated except render-target and depth-stencil which are deallocated automatically by reset method etc.).

virtual DWORD TRenderer::GetWidth void   )  const [pure virtual]
 

Returns resolution width.

virtual BOOL TRenderer::IsDebugMode void   )  const [pure virtual]
 

Determines whether render is in DEBUG mode.

virtual BOOL TRenderer::IsDepthStencilCompatible TRendererSurface surface  )  const [pure virtual]
 

This method only checks whether specified surface may be used as depth-stencil surface with actual render-target.

This method always returns valid value - in DEBUG and RETAIL mode.

Parameters:
surface [in] depth-stencil surface to check
Return values:
TRUE surfaces are compatible
FALSE surfaces are incompatible

virtual BOOL TRenderer::IsFormatCompressed EnumGraphicFormat  format  )  const [pure virtual]
 

Determines whether specified renderer format is compressed.

Parameters:
format [in] specified renderer format
Return values:
TRUE format is compressed
FALSE format is not compressed or invalid format

virtual BOOL TRenderer::IsFullscreen void   )  const [pure virtual]
 

Determines whether application runs in fullscreen.

virtual BOOL TRenderer::IsRenderTargetCompatible TRendererSurface surface  )  const [pure virtual]
 

This method only checks whether specified surface may be used as render-target surface with actual depth-stencil surface.

Parameters:
surface [in] render-target surface to check This method always returns valid value - in DEBUG and RETAIL mode.
surface [in] render-target surface to check
Return values:
TRUE surfaces are compatible
FALSE surfaces are incompatible

virtual BOOL TRenderer::IsRetailMode void   )  const [pure virtual]
 

Determines whether render is in RETAIL mode.

virtual EnumRetValue TRenderer::Present void   )  [pure virtual]
 

This method flip backbuffer to front buffer and scene is displayed at screen.

This method mustn't be called in block BeginScene()/EndScene(). This method always returns valid values.

Return values:
GRAPH_RET_OK method calling was successfull
GRAPH_RET_SCENESTARTED scene not finished (you must call EndScene())
GRAPH_RET_DEVICELOST device was lost, must be recreated
GRAPH_RET_ERROR critical error, renderer must be destroyed

Referenced by MainLoop().

virtual BOOL TRenderer::ReadRenderTargetSurface TRendererSurface destination,
TRendererSurface source
const [pure virtual]
 

Read data from surface created as render-target in VIDEO memory and save it into surface created in RAM memory.

This is the only one way how to read data from render-target surface in VIDEO memory. Both surfaces must have identical pixel format and dimensions! This method always returns valid values. Source and destination surface cannot be identical.

Parameters:
destination [in] destination surface created in RAM memory, see TRendererSurface::GetPool()
source [in] source render-target surface created in VIDEO memory, see TRendererSurface::GetPool() and TRendererSurface::IsRenderTarget() method

virtual BOOL TRenderer::ReadRenderTargetTextureCube EnumGraphicCubemapFaces  face,
TRendererTextureImage destination,
TRendererTextureCube source
const [pure virtual]
 

Reads one side from render-target texture and data store into texture created in RAM pool.

Source texture must be render-target type, thus must be created in VIDEO pool. Destination texture must be created in RAM memory. Both textures must have identical format, number mipmap levels and dimensions for each mipmap. This method call methods for surface updating.

Parameters:
face [in] valid cubemap face
destination [in] destination renderer texture created in SYSTEM pool
source [in] source renderer render-target texture created in VIDEO pool

virtual BOOL TRenderer::ReadRenderTargetTextureImage TRendererTextureImage destination,
TRendererTextureImage source
const [pure virtual]
 

Reads entire renderer render-target texture and data store into texture created in RAM pool.

Source texture must be render-target type, thus must be created in VIDEO pool. Destination texture must be created in RAM memory. Both textures must have identical format, number mipmap levels and dimensions for each mipmap. This method call methods for surface updating.

Parameters:
destination [in] destination renderer texture created in SYSTEM pool
source [in] source renderer render-target texture created in VIDEO pool

virtual BOOL TRenderer::ReadSurface TGraphicSurface destination,
TRendererSurface source
const [pure virtual]
 

Copy data from renderer surface into software surface (TGraphicSurface).

Both surfaces must have the same pixelformat and size. Source surface must be lockable - see TRendererSurface::IsLockable() method. It means that must be created as MANAGED or in RAM. Surfaces stored in VIDEO memory cannot be readed with this method. \TODO link to method to read other surfaces This method always returns valid values.

Parameters:
destination [in,out] software surface as destination surface (must be valid, see TGraphicSurface::IsLoaded() method)
source [in] renderer surface as source surface (must be lockable)

virtual BOOL TRenderer::ReadSurfaceRect TGraphicSurface destination,
TRendererSurface source,
const TRect dest_rect,
const TRect src_rect
const [pure virtual]
 

Copy data from specified rectangle on renderer surface into specified rectangle in software surface (TGraphicSurface).

Both surfaces must have the same pixelformat, size may be different, but size of both rectangles must be identical and both rectangles must be inside their surfaces. Source surface must be lockable - see TRendererSurface::IsLockable() method. It means that must be created as MANAGED or in RAM. Surfaces stored in VIDEO memory cannot be read with this method. This method always returns valid values.

Parameters:
destination [in,out] software surface for store result (must be valid, see TGraphicSurface::IsLoaded() method)
source [in] renderer surface as source surface (must be lockable)
dest_rect [in] rectangle on destination surface
src_rect [in] rectangle on source surface

virtual BOOL TRenderer::ReadTextureCube EnumGraphicCubemapFaces  face,
TGraphicTexture destination,
TRendererTextureCube source
const [pure virtual]
 

Reads data from specified side of renderer cubemap texture and store it in software texture.

Renderer texture must be lockable!!!

Both textures must have identical format, number mipmap levels and dimensions for each mipmap. Destination texture must be valid - see TGraphicSurface::IsLoaded() method. This method call methods for surface updating.

Parameters:
face [in] source cubemap side
destination [in] destination software texture - must be valid
source [in] source renderer texture created in RAM or MANAGED pool

virtual BOOL TRenderer::ReadTextureImage TGraphicTexture destination,
TRendererTextureImage source
const [pure virtual]
 

Reads data from entire renderer texture and store it in software texture.

Renderer texture must be lockable!!!

Both textures must have identical format, number mipmap levels and dimensions for each mipmap. Destination texture must be valid - see TGraphicSurface::IsLoaded() method. This method calls methods for surface updating.

Parameters:
destination [in] destination software texture - must be valid
source [in] source renderer texture created in RAM or MANAGED pool

virtual BOOL TRenderer::Release BOOL  force = FALSE  )  [pure virtual]
 

This method releases renderer if no resources are already allocated.

Before calling this method all resources should be released, only actual render-target and depth-stencil buffer may be active, thus number of VIDEO resources may be equal 2. This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
force [in] if this parameter is TRUE then renderer is destroyed even resources are allocated and TRUE is returned

Referenced by TGlobalsGraphic::Destroy().

virtual EnumRetValue TRenderer::Reset void   )  [pure virtual]
 

This method resets renderer from lost state into operational state.

Before calling this method all resources created in VIDEO memory must be released. Only actual render-target and depth-stencil buffer may be allocated (thus GetVideoResources() method returns 2) This method always returns valid values - in DEBUG and RETAIL mode.

Return values:
GRAPH_RET_ERROR critical error
GRAPH_RET_UNSUPPORTEDMODE unsupported display mode
GRAPH_RET_ALLOCRESOURCES resources in VIDEO memory are still allocated

virtual BOOL TRenderer::SetDepthStencil TRendererSurface surface  )  [pure virtual]
 

Sets new depth-stencil surface to renderer.

At first method check whether surface contains correct depth-stencil surface and if success, new depth-stencil is set. Old depth-stencil is released via Release() method. This method always returns valid value - in DEBUG and RETAIL mode.

Warning:
If this method success old deph-stencil is released via Release() (number of references is decreased) and number of references to new depth-stencil is incremented automatically!!!

Actualy set depth-stencil surface must be greater or equal to set render-target, if no then method will fail.

Parameters:
surface [in] pointer to surface with depth-stencil (after succedd calling number of references to it is automatically increased!!!)
Return values:
TRUE surface was successfully set
FALSE any error

virtual BOOL TRenderer::SetIndexBuffer TRendererIndexBuffer indexBuffer  )  [pure virtual]
 

Sets new index buffer to renderer.

Old index buffer is released via Release() method. This method always returns valid values - IN DEBUG and RETAIL mode.

Warning:
If this method success old index buffer is released via Release() (number of references is decreased) and number of references to new index buffer is incremented automatically!!!
Parameters:
indexBuffer [in] pointer to index buffer (after succedd calling number of references to it is automatically increased!!!)
Return values:
TRUE index buffer was set successfully
FALSE method fails

virtual BOOL TRenderer::SetPixelShader TRendererPixelShader shader  )  [pure virtual]
 

Sets new pixel shader to renderer.

Old pixel shader is released via Release() method. This method returns valid values only in DEBUG mode - in RELEASE mode always return TRUE

Warning:
If this method success old pixel shader is released via Release() (number of references is decreased) and number of references to new pixel shader is incremented automatically!!!
Parameters:
shader [in] pointer to pixel shader (after succedd calling number of references to it is automatically increased!!!)
Return values:
TRUE pixel shader was successfully set (always in RELEASE mode)
FALSE method fails

virtual BOOL TRenderer::SetPixelShaderConstantFloat DWORD  startBank,
DWORD  bankCount,
const float *  bankArray
[pure virtual]
 

This method set pixel shader constants to float shader registers.

Shader registers are organised into banks, where each bank contains four float values. You must set constant registers in entire banks, thus array bankArray must have size multiple of 4. See GetPixelShaderRegisterBanks() method. This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
startBank [in] index of first bank where will be stored shader constants
bankCount [in] number of banks in bankArray
bankArray [in] array with banks
Return values:
TRUE constants was set successfully
FALSE method fails

virtual BOOL TRenderer::SetRenderState EnumGraphicRenderState  state,
DWORD  value
[pure virtual]
 

This method set specified renderer state value.

For information about state types and their values see EnumGraphicRenderState. This method return valid values only in DEBUG mode, in RETAIL mode always return TRUE

Parameters:
state [in] state to set
value [in] state value to set
Return values:
TRUE method calling was successfull (always in RETAIL mode)
FALSE method fails

virtual BOOL TRenderer::SetRenderTarget TRendererSurface surface  )  [pure virtual]
 

Sets new render-target to renderer.

At first method check whether surface contains correct render-target and if success, new render-target is set. Old render-target is released via Release() method. This method always returns valid value - in DEBUG and RETAIL mode.

Warning:
If this method succedd old render target is released via Release() (number of references is decreased) and number of references to new render target is incremented automatically!!!

Actualy set depth-stencil surface must be greater or equal to set render-target, if no then method will fail.

Parameters:
surface [in] pointer to surface with render-target (after succedd calling number of references to it is automatically increased!!!)
Return values:
TRUE surface getting was successful
FALSE any error

virtual BOOL TRenderer::SetSamplerState DWORD  sampler,
EnumGraphicSamplerState  state,
DWORD  value
[pure virtual]
 

This method set specified sampler state.

For information about sampler state types and their values see EnumGraphicSamplerState. This method returns valid values only in DEBUG mode, in RETAIL mode always returns TRUE

Parameters:
sampler [in] sampler index
state [in] state to set - see EnumGraphicSamplerState type
value [in] new value to set - value type is according to EnumGraphicSamplerState
Return values:
TRUE method calling was successfull (always in RETAIL mode)
FALSE method fails

virtual BOOL TRenderer::SetTexture DWORD  stage,
TRendererTexture texture
[pure virtual]
 

Sets texture to given texture stage.

See GetTextureStagesCount(). This method increases number of references to texture in parameter if this is valid. If texture parameter is NULL then given texture stage has no texture. Old texture in given stage is released (via method Release()) If error occurs then state in given texture stage may be undefined, thus you must call this method again.

This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
stage [in] zero-based stage index
texture [in] pointer to texture (this texture must be renderable)
Return values:
TRUE texture was set successfully
FALSE texture setting failed

virtual BOOL TRenderer::SetVertexBuffer TRendererVertexBuffer vertexBuffer  )  [pure virtual]
 

Sets new vertex buffer to renderer.

Old vertex buffer is released via Release() method. If new VB is NULL old VB is released and into vertex buffer stream is set NULL (no VB) This method always returns valid values - IN DEBUG and RETAIL mode.

Warning:
If this method success old vertex buffer is released via Release() (number of references is decreased) and number of references to new vertex buffer is incremented automatically!!!
Parameters:
vertexBuffer [in] pointer to vertex buffer (after succedd calling number of references to it is automatically increased!!!)
Return values:
TRUE vertex buffer was set successfully
FALSE method fails

virtual BOOL TRenderer::SetVertexDeclaration TRendererVertexDeclaration declaration  )  [pure virtual]
 

Sets vertex declaration to renderer.

Old vertex declaration is released via Release() method (if exists). This method always return valid values - in DEBUG and RETAIN mode.

Warning:
If this method success old vertex declaration is released via Release() (number of references is decreased) and number of references to new vertex declaration is incremented automatically!!!
Parameters:
declaration [in] pointer to vertex declaration (after succedd calling number of references to it is automatically increased!!!), this parameter may be NULL
Return values:
TRUE method calling was successfull
FALSE method fails

virtual BOOL TRenderer::SetVertexShader TRendererVertexShader shader  )  [pure virtual]
 

Sets new vertex shader to renderer.

Old vertex shader is released via Release() method. This method returns valid values only in DEBUG mode - in RELEASE mode always return TRUE

Warning:
If this method success old vertex shader is released via Release() (number of references is decreased) and number of references to new vertex shader is incremented automatically!!!
Parameters:
shader [in] pointer to vertex shader (after succedd calling number of references to it is automatically increased!!!)
Return values:
TRUE vertex shader was successfully set (always in RELEASE mode)
FALSE method fails

virtual BOOL TRenderer::SetVertexShaderConstantFloat DWORD  startBank,
DWORD  bankCount,
const float *  bankArray
[pure virtual]
 

This method set vertex shader constants to float shader registers.

Shader registers are organised into banks, where each bank contains four float values. You must set constant registers in entire banks, thus array bankArray must have size multiple of 4. See GetPixelShaderRegisterBanks() method. This method always returns valid values - in DEBUG and RETAIL mode.

Parameters:
startBank [in] index of first bank where will be stored shader constants
bankCount [in] number of banks in bankArray
bankArray [in] array with banks
Return values:
TRUE constants was set successfully
FALSE method fails

virtual EnumRetValue TRenderer::SwapWindowMode void   )  [pure virtual]
 

Change from fullscreen to window mode and vice versa.

Function may failed if backbuffer format doesnt support both display modes (fullscreen and window). This method always returns valid values - in DEBUG and RETAIL mode.

Return values:
GRAPH_RET_ERROR critical error
GRAPH_RET_UNSUPPORTEDMODE unsupported display mode
GRAPH_RET_ALLOCRESOURCES resources in VIDEO memory are still allocated

virtual BOOL TRenderer::UpdateIndexBuffer TRendererIndexBuffer indexBuffer,
void *  data,
DWORD  startIndex,
DWORD  indices
[pure virtual]
 

Updates index buffer.

Index buffer may be static or dynamic. ITS RECOMMNEDED USE THIS METHOD ONLY FOR STATIC INDEX BUFFER, THERE ARE SPECIAL METHODS FOR DYNAMIC INDEX BUFFERS. In static buffer method check whether desired interval for indices <indexBuffer,indexBuffer+indices-1> is valid and then update this indices. In dynamic buffer method does the same and moreover it change information about number of valid indices in buffer (method TRendererIndexBuffer::GetIndicesCount()). New interval of valid indices is set as <0,startIndex+indices-1> (method TRendererVertexBuffer::GetIndicesCount() returns startIndex+indices) if original interval was less than new interval. In other case (original interval was higher) new interval is set to original interval - thus no change. Indices outside changed interval are staying unchanged. This method is only way how to change static index buffer, for dynamic buffer is its efficiency low, its better idea use specialized method for changing dynamic index buffers.

Parameters:
indexBuffer [in,out] index buffer
data [in] pointer to new index data
startIndex [in] zero-based index of first index where data will be stored - see TRendererIndexBuffer::GetIndexSize() for information about index size.
indices [in] number of vertices to store - see TRendererVertexBuffer::GetIndexSize() for information about index size.

virtual BOOL TRenderer::UpdateRenderTargetSurface TRendererSurface destination,
TRendererSurface source
const [pure virtual]
 

Update surface created as render-target in VIDEO memory from surface created in RAM memory.

This is the only one way how to upload data into render-target surface in VIDEO memory. Both surfaces must have identical pixel format and dimensions! This method always returns valid values. Destination and source surface cannot be identical.

Parameters:
destination [in] destination render-target surface created in VIDEO memory, see TRendererSurface::GetPool() and TRendererSurface::IsRenderTarget() method
source [in] source surface created in RAM memory, see TRendererSurface::GetPool()

virtual BOOL TRenderer::UpdateRenderTargetTextureCube EnumGraphicCubemapFaces  face,
TRendererTextureCube destination,
TRendererTextureImage source
const [pure virtual]
 

Updates one side from render-target cubemap texture with data from texture created in RAM pool.

Destination texture must be render-target type, thus must be created in VIDEO pool. Source texture must be created in RAM memory. Both textures must have identical format, number mipmap levels and dimensions for each mipmap. This method call methods for surface updating.

Parameters:
face [in] valid face in cubemap texture
destination [in] destination renderer render-target cubemap texture created in VIDEO pool
source [in] source renderer texture created in SYSTEM pool

virtual BOOL TRenderer::UpdateRenderTargetTextureImage TRendererTextureImage destination,
TRendererTextureImage source
const [pure virtual]
 

Updates entire renderer render-target texture with data from texture created in RAM pool.

Destination texture must be render-target type, thus must be created in VIDEO pool. Source texture must be created in RAM memory. Both textures must have identical format, number mipmap levels and dimensions for each mipmap. This method call methods for surface updating.

Parameters:
destination [in] destination renderer render-target texture created in VIDEO pool
source [in] source renderer texture created in SYSTEM pool

virtual BOOL TRenderer::UpdateSurface TRendererSurface destination,
const TGraphicSurface source
const [pure virtual]
 

Copy data from software surface (TGraphicSurface) into renderer surface.

Both surfaces must have the same pixelformat and size. Destination surface must be lockable - see TRendererSurface::IsLockable() method. It means that must be created as MANAGED or in RAM. Surfaces stored in VIDEO memory cannot be updated with this method. This method always returns valid values.

Parameters:
destination [in,out] renderer surface for store result (must be lockable)
source [in] software surface as source surface (must be valid, see TGraphicSurface::IsLoaded() method)

virtual BOOL TRenderer::UpdateSurfaceDynamic TRendererSurface destination,
const TGraphicSurface source
const [pure virtual]
 

Update entire dynamic surface.

This method directly call TRenderer::UpdateSurfaceDynamic method. This method can be called only on surface created as DYNAMIC (thus created in dynamic texture)

Parameters:
destination [in] destination surface which must be dynamic and lockable
source [in] source surface which must have same dimensions and pixelformat and must be lockable (created in VIDEO pool as DYNAMIC)

virtual BOOL TRenderer::UpdateSurfaceRect TRendererSurface destination,
const TGraphicSurface source,
const TRect dest_rect,
const TRect src_rect
const [pure virtual]
 

Copy data from specified rectangle on software surface (TGraphicSurface) into specified rectangle renderer surface.

Both surfaces must have the same pixelformat, size may be different, but size of both rectangles must be identical and both rectabgles must be inside their surfaces. Destination surface must be lockable - see TRendererSurface::IsLockable() method. It means that must be created as MANAGED or in RAM. Surfaces stored in VIDEO memory cannot be updated with this method. This method always returns valid values.

Parameters:
destination [in,out] renderer surface for store result (must be lockable)
source [in] software surface as source surface (must be valid, see TGraphicSurface::IsLoaded() method)
dest_rect [in] rectangle on destination surface
src_rect [in] rectangle on source surface

virtual BOOL TRenderer::UpdateTextureCube EnumGraphicCubemapFaces  face,
TRendererTextureCube destination,
const TGraphicTexture source
const [pure virtual]
 

Updates specified side of cubemap with data from software texture.

Cubemap texture must be lockable!!!

Both textures must have identical format, number mipmap levels and dimensions for each mipmap (side of cubemap). Source texture must be valid - see TGraphicSurface::IsLoaded() method. This method call methods for surface updating.

Parameters:
face [in] destination cubemap side
destination [in] destination renderer texture created in RAM or MANAGED pool
source [in] source software texture - must be valid

virtual BOOL TRenderer::UpdateTextureImage TRendererTextureImage destination,
const TGraphicTexture source
const [pure virtual]
 

Updates entire renderer texture from software texture.

Renderer texture must be lockable.

Both textures must have identical format, number mipmap levels and dimensions for each mipmap. Source texture must be valid - see TGraphicSurface::IsLoaded() method. This method calls methods for surface updating.

Parameters:
destination [in] destination renderer texture created in RAM or MANAGED pool
source [in] source software texture - must be valid

virtual BOOL TRenderer::UpdateTextureImageDynamic TRendererTextureImage destination,
const TGraphicTexture source
const [pure virtual]
 

Updates entire renderer dynamic texture from software texture.

Renderer texture must be lockable and dynamic!!!

Source texture must be valid - see TGraphicSurface::IsLoaded() method. This method calls methods for surface updating.

Parameters:
destination [in] destination renderer texture created as DYNAMIC
source [in] source software texture - must be valid

virtual BOOL TRenderer::UpdateVertexBuffer TRendererVertexBuffer vertexBuffer,
void *  data,
DWORD  startVertex,
DWORD  vertices
[pure virtual]
 

Updates vertex buffer.

Vertex buffer may be static or dynamic. ITS RECOMMNEDED USE THIS METHOD ONLY FOR STATIC VERTEX BUFFER, THERE ARE SPECIAL METHODS FOR DYNAMIC VERTEX BUFFERS. In static buffer method check whether desired interval for vertices <startVertex,startVertex+vertices-1> is valid and then update this vertices. In dynamic buffer method does the same and moreover it change information about number of valid vertices in vertex buffer (method TRendererVertexBuffer::GetVerticesCount()). New interval of valid vertices is set as <0,startVertex+vertices-1> (method TRendererVertexBuffer::GetVerticesCount() returns startVertex+vertices) if original interval was less than new interval. In other case (original interval was higher) new interval is set to original interval - thus no change. Vertices outside changed interval are staying unchanged. This method is only way how to change static vertex buffer, for dynamic buffer is its efficiency low, its better idea use specialized method for changing dynamic vertex buffers.

Parameters:
vertexBuffer [in,out] vertex buffer
data [in] pointer to new vertex data
startVertex [in] zero-based index of first vertex where data will be stored - see TRendererVertexBuffer::GetVertexSize() for information about vertex size.
vertices [in] number of vertices to store - see TRendererVertexBuffer::GetVertexSize() for information about vertex size.


The documentation for this class was generated from the following file:
Generated on Wed Nov 28 22:43:32 2007 for Joy4D by  doxygen 1.4.6-NO