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

# deRender Class Reference

`#include <deRender_priv.hpp>`

Inheritance diagram for deRender:

[legend]
Collaboration diagram for deRender:

[legend]
List of all members.

## Public Member Functions
| deRender (void)
| ~deRender (void)
deBoolean | SetRenderFlag (IdeRender::RenderFlag_t Flag)
deBoolean | SetStencilState (IdeDriver *pDriver, StencilType_t Stencil, DWORD Ref, DWORD X=0, IdeDriver::RenderCmpFunc Comparison=IdeDriver::COMPARE_ALWAYS, IdeDriver::RenderState StencilTest=IdeDriver::RENDER_STENCILPASS, DWORD StencilMask=0xff, DWORD WriteMask=0xff)
deBoolean | Render (IdeCamera *cam, deDouble DeltaTime, deBoolean UseSG, deBoolean ClearColorBuffer, deBoolean BeginFrame, deBoolean EndFrame)
deBoolean | RenderTexture (IdeBitmap *Target, IdeCamera *cam, deDouble DeltaTime)
deBoolean | BeginFrame (HWND WindowHandle, deBoolean ClearColorBuffer)
deBoolean | EndFrame (HWND WindowHandle, deDouble DeltaTime)
void | RenderPrepBuffer (deRenderObject &obj)
IdeDriver * | CurrentPassDriver ()
void | RenderPrepBatch (long Level, IdePortal *Portal, deRect &Viewport, deTransformInfo *PortalPos, deTransformInfo *Concat)
deDouble | GetTimeStep ()
void | SetDriverPath (const char *RelativePath)
| set the relative path that contains Destiny3D driver files (defaults to "." which is current directory)
IdeDriverLoad * | GetDriverLoad ()
| returns a pointer to internally-held IdeDriverLoad interface
IdeDriver * | AttachToWindow (HWND hWnd, char *DriverName="Direct3D8")
deBoolean | DetachFromWindow (HWND hWnd)
| detach and destroy a driver attached to the specified window
void | UpdateWindow (HWND hWnd)
| update the driver's knowledge of the window's client rect, ie after a WM_SIZE message is received
void | UpdateDisplay ()
deBoolean | LoadDriver (HWND hWnd, IdeDriver::deDisplay *Display, char *DriverName)
deBoolean | GetResolution (IdeDriver *pDriver, long Adapter, long EntryNum, long *Width, long *Height, long *RefreshRate)
deBoolean | QueryFormat (IdeDriver *pDriver, IdeDriver::deDisplay *Display, deBoolean PreferStencil)
void | SetBGColor (deARGB color)
void | SetMaxTPortalDepth (long Depth)
void | SetMaxLights (long MaxHWLights, long MaxTexLights)
deBoolean | ClearBackground (HWND hWnd, deARGB color=0x00000000, deBoolean ClearZ=DE_TRUE)
| clear the entire color-buffer to a specified color, possibly also clearing the Z-buffer
void | EnableTexturing (deBoolean Enabled)
| enable or disable texturing on all geometry rendered through this interface
deBoolean | Use2DCollection (HWND hWnd, Ide2DCollection *Collection)
Ide2DCollection * | Get2DCollection (HWND hWnd)
void | SetStatStruct (deRenderStats *StatStruct)
deBoolean | Screenshot (HWND hWnd, const char *filename, long ScreenSizes)
long | GetFrameNum ()
## Private Types
typedef deTBST< deRenderObject, 3 > | t_ObjectTree
## Private Member Functions
deBoolean | RenderWaterMark (IdeDriver *pDriver)
IdeDriver * | GetDriver (HWND hWnd)
deBoolean | InitDriver (IdeDriver *driver, HWND hWnd, IdeDriver::deDisplay *display, deBoolean ResetOnly)
void | SetInFrame (HWND hWnd, deBoolean InFrame)
deBoolean | IsInFrame (HWND hWnd, deBoolean ErrorVal)
IdeDriver * | SetupRenderTarget (IdeBitmap *Target, IdeCamera *cam)
deBoolean | SetSubViewport (IdeDriver *pDriver, IdeCamera *cam, deRect SubRect)
deBoolean | SetScissorRect (IdeDriver *pDriver, deRect ScissorRect)
deBoolean | RenderGeometry (IdeDriver *pDriver, IdeSceneGraph *SG, IdeCamera *c, deDouble DeltaTime, deBoolean ClearColorBuffer, deBoolean BeginFrame, deBoolean EndFrame)
deBoolean | CheckColorFormat (IdeDriver::BPP Bpp)
deBoolean | CheckDepthFormat (IdeDriver::ZPP Zpp, deBoolean Windowed)
deBoolean | RenderBatch (deRenderPassInfo *pInfo)
## Static Private Member Functions
void | DestroyDriverLinkages ()
## Private Attributes
IdeRenderTexture * | m_WaterMarkTex
IdeVertexBuffer * | m_WaterMarkVB
deTList< deRenderBatch > | m_RenderBatches
deTStack< IdeDriver * > | m_CurrentPassDriver
deDouble | m_CurrentTimeStep
deBoolean | m_TexturesEnabled
deBoolean | m_RenderMeshOverFill
deBoolean | m_RenderSolidWireframe
long | m_FillState
long | m_CullState
deARGB | m_BGColor
deRenderStats * | m_RenderStats
deString | m_DriverPath
long | m_FrameNum
long | m_TPortalDepth
long | m_MaxHWLights
long | m_MaxTexLights
long | m_LightsEncountered
IdeRenderLight * | m_LightsPerPass [(8)]
IdeRenderTexture * | m_PassTexture
## Static Private Attributes
deRenderStats | s_RenderStats
deRender * | s_deRenderSingleton = NULL
IdeDriverLoad * | s_DriverLoad = NULL
IdeRenderTexture * | s_BlankTex = NULL
IdeRenderMaterial * | s_BlankMat = NULL
deTArray< DriverInfo > | m_DriverList
## Friends
IdeRender * | IdeRender_GetPtr ()
| get a pointer to an IdeRender singleton.
deBoolean | IdeRender_Initialize ()
| initialize the Render system
void | IdeRender_Destroy ()
| destroy the IdeRender singleton
void | IdeRender_DestroyDriverLinkages ()
| release all drivers held by IdeDriver

## Member Typedef Documentation

typedef deTBST<deRenderObject, 3> deRender::t_ObjectTree`[private]`

## Constructor & Destructor Documentation

deRender::deRender | ( | void |  | ) |

deRender::~deRender | ( | void |  | ) |

## Member Function Documentation

IdeDriver * deRender::AttachToWindow | ( | HWND | hWnd,
|  | char * | DriverName = "Direct3D8"
| ) | `[virtual]`

  | attach a driver to the specified window. The driver will not be ready for rendering Returns: a valid IdeDriver pointer if success, NULL if failure Parameters:
  hWnd | a valid window handle to attach a driver to
  DriverName | (optional, defualt = "Direct3D8") string containing the name of driver to use
Implements IdeRender.

deBoolean deRender::BeginFrame | ( | HWND | WindowHandle,
|  | deBoolean | ClearColorBuffer
| ) | `[virtual]`

  | begin a frame before rendering geometry. Parameters:
  WindowHandle | the window with an attached driver to be used
  ClearColorBuffer | (optional, default true) if true, the color buffer will be cleared to the stored BGColor
Implements IdeRender.

deBoolean deRender::CheckColorFormat | ( | IdeDriver::BPP | Bpp | ) | `[private]`

deBoolean deRender::CheckDepthFormat | ( | IdeDriver::ZPP | Zpp,
|  | deBoolean | Windowed
| ) | `[private]`

deBoolean deRender::ClearBackground | ( | HWND | hWnd,
|  | deARGB | color = 0x00000000,
|  | deBoolean | ClearZ = DE_TRUE
| ) | `[virtual]`

| clear the entire color-buffer to a specified color, possibly also clearing the Z-buffer Implements IdeRender.

IdeDriver * deRender::CurrentPassDriver | ( |  | ) | `[virtual]`

| Implements IdeRender.

void deRender::DestroyDriverLinkages | ( |  | ) | `[static, private]`

deBoolean deRender::DetachFromWindow | ( | HWND | hWnd | ) | `[virtual]`

| detach and destroy a driver attached to the specified window Implements IdeRender.

void deRender::EnableTexturing | ( | deBoolean | Enabled | ) | `[virtual]`

| enable or disable texturing on all geometry rendered through this interface Implements IdeRender.

deBoolean deRender::EndFrame | ( | HWND | WindowHandle,
|  | deDouble | DeltaTime
| ) | `[virtual]`

  | end a frame and present the back-buffer to the screen Parameters:
  WindowHandle | the window with an attached driver to be used
  DeltaTime | time elapsed since the last call to EndFrame
Implements IdeRender.

Ide2DCollection * deRender::Get2DCollection | ( | HWND | hWnd | ) | `[virtual]`

| Get the 2D collection that is being used by the driver attached to specified window. This method does NOT invoke Claim() on the returned collection, but user code may do so. Implements IdeRender.

IdeDriver * deRender::GetDriver | ( | HWND | hWnd | ) | `[private]`

IdeDriverLoad * deRender::GetDriverLoad | ( |  | ) | `[virtual]`

| returns a pointer to internally-held IdeDriverLoad interface Implements IdeRender.

long deRender::GetFrameNum | ( |  | ) | `[virtual]`

| get the current frame ID number. clamped to [0 <-> 2^31-1] Implements IdeRender.

deBoolean deRender::GetResolution | ( | IdeDriver * | pDriver,
|  | long | Adapter,
|  | long | EntryNum,
|  | long * | Width,
|  | long * | Height,
|  | long * | RefreshRate
| ) | `[virtual]`

  | check a driver-enumerated resolution Returns: false if pDriver is NULL or if Adapter or EntryNum are outside valid ranges, true otherwise Parameters:
  Width | pointer to integer to store width of entry into
  Height | pointer to integer to store height of entry into
  RefreshRate | pointer to integer to store screen refresh rate (in hertz) of entry into
Implements IdeRender.

deDouble deRender::GetTimeStep | ( |  | ) | `[virtual]`

| Implements IdeRender.

deBoolean deRender::InitDriver | ( | IdeDriver * | driver,
|  | HWND | hWnd,
|  | IdeDriver::deDisplay * | display,
|  | deBoolean | ResetOnly
| ) | `[private]`

deBoolean deRender::IsInFrame | ( | HWND | hWnd,
|  | deBoolean | ErrorVal
| ) | `[private]`

deBoolean deRender::LoadDriver | ( | HWND | hWnd,
|  | IdeDriver::deDisplay * | Display,
|  | char * | DriverName
| ) | `[virtual]`

  | load a driver up and prepare it for rendering Returns: true if successful, false if failure to use specified format Parameters:
  hWnd | a valid window handle to attach a driver to
  Display | user-filled driver settings to be used in initializing the driver.
  DriverName | (optional, defualt = "Direct3D") string containing the name of driver to use
Implements IdeRender.

deBoolean deRender::QueryFormat | ( | IdeDriver * | pDriver,
|  | IdeDriver::deDisplay * | Display,
|  | deBoolean | PreferStencil
| ) | `[virtual]`

  | a rather high-level method of finding a format close to what you want for z-buffer. Precondition: Adapter, Bpp, and Windowed variables in Display set to appropriate values. ZDepth and StencilDepth values in Display set to minimum acceptable bit-depth values. Postcondition: Display contains a valid combination of values to call LoadDriver() with. The user should check the values of ZDepth, StencilDepth, and Zpp upon failure, so that he can adjust game settings to what is possible. Returns: true if a format was found that satisfies criteria set, false if criteria could not be met. Parameters:
  pDriver | pointer to a valid IdeDriver interface
  Display | pointer to a IdeDriver::deDisplay structure meeting the pre-requisites
  PreferStencil | upon failure to find a good format, satisfy stencil buffer needs before depth-buffer needs (if true)
Implements IdeRender.

deBoolean deRender::Render | ( | IdeCamera * | cam,
|  | deDouble | DeltaTime,
|  | deBoolean | UseSG,
|  | deBoolean | ClearColorBuffer,
|  | deBoolean | BeginFrame,
|  | deBoolean | EndFrame
| ) | `[virtual]`

  | Render a scene from a given vantage point, possibly doing some cleanup work with optional params Parameters:
  cam | a camera containing details of how to render the scene
  DeltaTime | time elapsed since the last call to Render
  UseSG | set to true if the scenegraph is to be traversed
  ClearColorBuffer | (optional, default false) if true, the color buffer will be cleared to the stored BGColor
  BeginFrame | (optional, default false) will call BeginFrame(...) for you
  EndFrame | (optional, default false) will call EndFrame(...) for you
Implements IdeRender.

deBoolean deRender::RenderBatch | ( | deRenderPassInfo * | pInfo | ) | `[private]`

deBoolean deRender::RenderGeometry | ( | IdeDriver * | pDriver,
|  | IdeSceneGraph * | SG,
|  | IdeCamera * | c,
|  | deDouble | DeltaTime,
|  | deBoolean | ClearColorBuffer,
|  | deBoolean | BeginFrame,
|  | deBoolean | EndFrame
| ) | `[private]`

void deRender::RenderPrepBatch | ( | long | Level,
|  | IdePortal * | Portal,
|  | deRect & | Viewport,
|  | deTransformInfo * | PortalPos,
|  | deTransformInfo * | Concat
| ) | `[virtual]`

| Implements IdeRender.

void deRender::RenderPrepBuffer | ( | deRenderObject & | obj | ) | `[virtual]`

| Implements IdeRender.

deBoolean deRender::RenderTexture | ( | IdeBitmap * | Target,
|  | IdeCamera * | cam,
|  | deDouble | DeltaTime
| ) | `[virtual]`

  | Just like Render() except instead of rendering to the screen, it renders to a texture. the texture to be used is handled through the Target parameter, and the texture on the video hardware after the render will not match the bitmap in system memory. BeginFrame should still be called before this method, so that statistics are properly handled. The camera's viewport will be used when rendering to the texture, so the camera viewport must be the correct size for the texture being rendered into. However, the aspect ratio of the camera can be locked to something other than width/height so that the texture can be mapped in a way that doesn't require it to be viewed as square. Parameters:
  Target | The bitmap which acts as the handle to the texture to be rendered into. This bitmap must have been added to the driver after having been set to have render-target capability.
Implements IdeRender.

deBoolean deRender::RenderWaterMark | ( | IdeDriver * | pDriver | ) | `[private]`

deBoolean deRender::Screenshot | ( | HWND | hWnd,
|  | const char * | filename,
|  | long | ScreenSizes
| ) | `[virtual]`

| Implements IdeRender.

void deRender::SetBGColor | ( | deARGB | color | ) | `[virtual]`

| set the color that the color-buffer will be cleared to. ie, 0x00102030 will set the color to 16 red intensity, 32 green intensity, and 48 blue intensity out of a maximum intensity of 255 Implements IdeRender.

void deRender::SetDriverPath | ( | const char * | RelativePath | ) | `[virtual]`

| set the relative path that contains Destiny3D driver files (defaults to "." which is current directory) Implements IdeRender.

void deRender::SetInFrame | ( | HWND | hWnd,
|  | deBoolean | InFrame
| ) | `[private]`

void deRender::SetMaxLights | ( | long | MaxHWLights,
|  | long | MaxTexLights
| ) | `[virtual]`

| Implements IdeRender.

void deRender::SetMaxTPortalDepth | ( | long | Depth | ) | `[virtual]`

| set the maximum depth of T-portal progression. Each T-Portal clears a portion of the screen as part of the rendering process, so using a high number can adversely affect your framerate. Default value = 8. Implements IdeRender.

deBoolean deRender::SetRenderFlag | ( | IdeRender::RenderFlag_t | Flag | ) | `[virtual]`

| set a flag for the next call to Render to use. see IdeRender::RenderFlag_t for notes on usage Implements IdeRender.

deBoolean deRender::SetScissorRect | ( | IdeDriver * | pDriver,
|  | deRect | ScissorRect
| ) | `[private]`

void deRender::SetStatStruct | ( | deRenderStats * | StatStruct | ) | `[virtual]`

| call before BeginFrame with a user-handled instance of the structure to be filled with information. the data will be valid after a call to Render() or EndFrame() Implements IdeRender.

deBoolean deRender::SetStencilState | ( | IdeDriver * | pDriver,
|  | StencilType_t | Stencil,
|  | DWORD | Ref,
|  | DWORD | X = 0,
|  | IdeDriver::RenderCmpFunc | Comparison = IdeDriver::COMPARE_ALWAYS,
|  | IdeDriver::RenderState | StencilTest = IdeDriver::RENDER_STENCILPASS,
|  | DWORD | StencilMask = 0xff,
|  | DWORD | WriteMask = 0xff
| ) | `[virtual]`

  | Set a pre-defined stencil method. notes on how stenciling works and what it does: (StencilRef & StencilMask) RenderCmpFunc (StencilBufferValue & StencilMask) That is the comparison performed for each pixel drawn when stenciling is enabled. The StencilRef value is compared with the StencilBufferValue, using a comparison function to evaluate success or failure of the test. If the stencil test fails, the operation for STENCILFAIL will be performed. If the stencil test passes and the depth-test fails, the operatation for STENCILZFAIL will be performed. If both the stencil and depth tests pass, the operation for STENCILPASS will be performed. If modifying values in the stencil buffer, the write-mask is applied to the bits being altered. Using the StencilMaks and WriteMask, you can effectively store more than one useful "channel" of stencil information and modify it. However, there is usually a maximum of 8 bits available for use in stenciling, so not too much detail can be stored if the stencil channel is being "shared" in such a way. For Destiny3D, the aim is to perform stenciled lighting and stenciled portaling on the same geometry by sharing out the stencil buffer in this manner. Parameters:
  pDriver | valid render-capable driver
  Stencil | any valid value of StencilType_t
  Ref | the StencilRef value
  X | a special-use flag argument, used with some stencil types to specify behavior
  Comparison | a comparison function for comparing current stencil value to reference value. see IdeDriver documentation for notes on how stenciling works
  StencilTest | the test for which the operation will be performed. Default is STENCILPASS, can also be STENCILFAIL or STENCILZFAIL
  StencilMask | the stenciling read-mask
  WriteMask | the stenciling write-mask
Implements IdeRender.

deBoolean deRender::SetSubViewport | ( | IdeDriver * | pDriver,
|  | IdeCamera * | cam,
|  | deRect | SubRect
| ) | `[private]`

IdeDriver * deRender::SetupRenderTarget | ( | IdeBitmap * | Target,
|  | IdeCamera * | cam
| ) | `[private]`

void deRender::UpdateDisplay | ( |  | ) | `[virtual]`

| Implements IdeRender.

void deRender::UpdateWindow | ( | HWND | hWnd | ) | `[virtual]`

| update the driver's knowledge of the window's client rect, ie after a WM_SIZE message is received Implements IdeRender.

deBoolean deRender::Use2DCollection | ( | HWND | hWnd,
|  | Ide2DCollection * | Collection
| ) | `[virtual]`

| Specify a user-handled 2D collection for a driver attached to specified window to use. This method invokes Collection->Claim(), and then Release() on its currently held collection. Implements IdeRender.

## Friends And Related Function Documentation

void IdeRender_Destroy | ( |  | ) | `[friend]`

| destroy the IdeRender singleton

void IdeRender_DestroyDriverLinkages | ( |  | ) | `[friend]`

| release all drivers held by IdeDriver

IdeRender* IdeRender_GetPtr | ( |  | ) | `[friend]`

| get a pointer to an IdeRender singleton.

deBoolean IdeRender_Initialize | ( |  | ) | `[friend]`

| initialize the Render system

## Member Data Documentation

deARGB deRender::m_BGColor`[private]`

long deRender::m_CullState`[private]`

deTStack<IdeDriver*> deRender::m_CurrentPassDriver`[private]`

deDouble deRender::m_CurrentTimeStep`[private]`

deTArray< deRender::DriverInfo > deRender::m_DriverList`[static, private]`

deString deRender::m_DriverPath`[private]`

long deRender::m_FillState`[private]`

long deRender::m_FrameNum`[private]`

long deRender::m_LightsEncountered`[private]`

IdeRenderLight* deRender::m_LightsPerPass[ (8) ]`[private]`

long deRender::m_MaxHWLights`[private]`

long deRender::m_MaxTexLights`[private]`

IdeRenderTexture* deRender::m_PassTexture`[private]`

deTList<deRenderBatch> deRender::m_RenderBatches`[private]`

deBoolean deRender::m_RenderMeshOverFill`[private]`

deBoolean deRender::m_RenderSolidWireframe`[private]`

deRenderStats* deRender::m_RenderStats`[private]`

deBoolean deRender::m_TexturesEnabled`[private]`

long deRender::m_TPortalDepth`[private]`

IdeRenderTexture* deRender::m_WaterMarkTex`[private]`

IdeVertexBuffer* deRender::m_WaterMarkVB`[private]`

IdeRenderMaterial * deRender::s_BlankMat = NULL`[static, private]`

IdeRenderTexture * deRender::s_BlankTex = NULL`[static, private]`

deRender * deRender::s_deRenderSingleton = NULL`[static, private]`

IdeDriverLoad * deRender::s_DriverLoad = NULL`[static, private]`

IdeRender::deRenderStats deRender::s_RenderStats`[static, private]`

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

- deRender_priv.hpp
- deRender.cpp
- RenderCode.cpp