"L. Spiro Engine"
Classes | Public Types | Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes

lsg::CDirectX9 Class Reference

Interface with the DirectX 9 API. More...

#include <LSGDirectX9.h>

List of all members.

Classes

struct  LSG_DIRECTX9_INIT

Public Types

typedef struct
lsg::CDirectX9::LSG_DIRECTX9_INIT
LPLSG_DIRECTX9_INIT
typedef struct
lsg::CDirectX9::LSG_DIRECTX9_INIT 
LPCLSG_DIRECTX9_INIT

Static Public Member Functions

static LSBOOL LSE_CALL InitDirectX9 (LPCLSG_DIRECTX9_INIT _lpdiInit)
static LSVOID LSE_CALL PostInitDirectX9 ()
static LSVOID LSE_CALL DestroyDirectX9 ()
static LSVOID LSE_CALL LoseDevice ()
static LSBOOL LSE_CALL ResetDevice ()
static LSE_INLINE LSBOOL LSE_CALL DeviceIsLost ()
static LSE_INLINE LSVOID LSE_CALL TogglingFullScreen (LSBOOL _bVal)
static LSE_INLINE LSVOID LSE_CALL SetWindowParms (LSBOOL _bWindowed, HWND _hWnd)
static LSVOID LSE_CALL SetInitialValues ()
static LSVOID LSE_CALL SetScreenSize (LSUINT32 _ui32Width, LSUINT32 _ui32Height)
static IDirect3DDevice9 * GetDirectX9Device ()
static IDirect3D9 * GetDirectX9Object ()
static const
D3DDEVICE_CREATION_PARAMETERS & 
GetCreationParms ()
static LSE_INLINE const
D3DCAPS9 &LSE_CALL 
GetDeviceCaps ()
static LSE_INLINE const
D3DPRESENT_PARAMETERS
&LSE_CALL 
GetPresentParms ()
static LSE_INLINE
IDirect3DSurface9 *LSE_CALL 
GetBackBufferSurface ()
static LSE_INLINE
IDirect3DSurface9 *LSE_CALL 
GetDepthStencilSurface ()
static LSE_INLINE LSVOID LSE_FCALL SetMinMagMipFilters (LSUINT32 _ui32Slot, D3DTEXTUREFILTERTYPE _tftMin, D3DTEXTUREFILTERTYPE _tftMag, D3DTEXTUREFILTERTYPE _tftMip)
static LSE_INLINE LSVOID LSE_FCALL SetAnisotropy (LSUINT32 _ui32Slot, LSUINT32 _ui32Level)
static LSE_INLINE LSVOID LSE_FCALL SetTextureWrapModes (LSUINT32 _ui32Slot, D3DTEXTUREADDRESS _taU, D3DTEXTUREADDRESS _taV)
static CMatrix4x4 LSE_CALL OffsetOrtho (LSREAL _fLeft, LSREAL _fRight, LSREAL _fBottom, LSREAL _fTop, LSREAL _fNear, LSREAL _fFar)
static LSE_INLINE LSVOID LSE_FCALL AssertError ()
static LSE_INLINE LSVOID LSE_FCALL Present ()
static LSE_INLINE LSVOID LSE_FCALL Clear (LSUINT32 _ui32Mask)
static LSE_INLINE LSVOID LSE_FCALL ClearAll ()
static LSVOID LSE_CALL SetClearColor (LSREAL _fR, LSREAL _fG, LSREAL _fB, LSREAL _fA)
static LSE_INLINE LSVOID LSE_FCALL SetClearDepth (LSREAL _fValue)
static LSE_INLINE LSVOID LSE_FCALL SetViewport (LSINT32 _i32X, LSINT32 _i32Y, LSINT32 _i32Width, LSINT32 _i32Height)
static LSE_INLINE LSVOID LSE_FCALL SetDepthTest (LSBOOL _bVal)
static LSE_INLINE LSVOID LSE_FCALL SetDepthFunc (LSG_DEPTH_TEST _dtFunc)
static LSE_INLINE LSVOID LSE_FCALL SetDepthWrite (LSBOOL _bVal)
static LSE_INLINE LSVOID LSE_FCALL SetCulling (LSBOOL _bVal)
static LSE_INLINE LSVOID LSE_FCALL SetCullMode (LSG_CULL_MODES _cmMode)
static LSE_INLINE
LSG_CULL_MODES LSE_CALL 
GetCullMode ()
static LSE_INLINE LSVOID LSE_FCALL SetBlendEnabled (LSBOOL _bVal)
static LSE_INLINE LSVOID LSE_FCALL SetBlendFunc (LSG_BLEND_MODES _bmSrc, LSG_BLEND_MODES _bmDst)
static LSE_INLINE LSVOID LSE_FCALL SetFillMode (LSG_FILL_MODES _fmMode)
static LSE_INLINE LSBOOL LSE_FCALL BeginRender ()
static LSE_INLINE LSVOID LSE_FCALL EndRender ()
static LSE_INLINE
CShaderManager *LSE_FCALL 
GetShaderManager ()
static LSVOID LSE_FCALL SetShader (CShader *_psShader)
static CShader *LSE_FCALL GetShader ()
static LSVOID LSE_CALL PreRender ()
static LSE_INLINE LSBOOL LSE_CALL NonPo2 ()
template<typename tnType >
static LSE_INLINE LSVOID LSE_CALL SafeRelease (tnType &_tObj)

Static Protected Member Functions

static LSVOID LSE_CALL ResetInternal ()

Static Protected Attributes

static IDirect3DDevice9 * m_pd3dDevice
static IDirect3D9 * m_d3dObject
static IDirect3DSurface9 * m_pd3s9Back
static IDirect3DSurface9 * m_pd3s9DepthStencil
static D3DCAPS9 m_cCaps
static
D3DDEVICE_CREATION_PARAMETERS 
m_dcpCreationParms
static LSG_CULL_MODES m_cmCullMode
static LSINT32 m_i32VertProcType
static D3DPRESENT_PARAMETERS m_ppPresentParms
static CShaderManagerm_psmShaderMan
static LSUINT32 m_ui32ClearColor
static LSFLOAT m_fDepthClear
static LSBOOL m_bDeviceLost
static LSBOOL m_bToggling
static LSBOOL m_bDepthTest
static LSBOOL m_bCulling
static D3DTEXTUREFILTERTYPE m_tftMinFilter [LSG_MAX_TEXTURE_UNITS]
static D3DTEXTUREFILTERTYPE m_tftMagFilter [LSG_MAX_TEXTURE_UNITS]
static D3DTEXTUREFILTERTYPE m_tftMipFilter [LSG_MAX_TEXTURE_UNITS]
static LSUINT32 m_ui32AnisoLevel [LSG_MAX_TEXTURE_UNITS]
static D3DTEXTUREADDRESS m_taWrapU [LSG_MAX_TEXTURE_UNITS]
static D3DTEXTUREADDRESS m_taWrapV [LSG_MAX_TEXTURE_UNITS]

Detailed Description

Interface with the DirectX 9 API.

Class CDirectX9 Description: Interface with the DirectX 9 API.


Member Typedef Documentation

Data needed to initialize the device.


Member Function Documentation

LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::AssertError ( ) [static]

Does nothing.

LSE_INLINE LSBOOL LSE_FCALL lsg::CDirectX9::BeginRender ( ) [static]

Begin rendering. Must be called once per frame only, before any rendering takes place.

Returns:
Returns true if the rendering device is ready.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::Clear ( LSUINT32  _ui32Mask) [static]

Clear the active buffer of the given type(s).

Parameters:
_ui32MaskThe buffer(s) to clear. Must be one or more LSG_BUFFERS enumerated values.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::ClearAll ( ) [static]

Clear all active buffers.

static LSVOID LSE_CALL lsg::CDirectX9::DestroyDirectX9 ( ) [static]

Destroy DirectX 9 one time at engine shutdown.

LSE_INLINE LSBOOL LSE_CALL lsg::CDirectX9::DeviceIsLost ( ) [static]

Determines whether or not the device is lost.

Returns:
Returns true if the device is lost.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::EndRender ( ) [static]

End rendering. Must be called once per frame only, after all rendering is done.

LSE_INLINE IDirect3DSurface9 *LSE_CALL lsg::CDirectX9::GetBackBufferSurface ( ) [static]

Gets the back buffer surface pointer.

Returns:
Returns the back buffer surface pointer.
LSE_INLINE const D3DDEVICE_CREATION_PARAMETERS & lsg::CDirectX9::GetCreationParms ( ) [static]

Gets the parameters used to create the DirectX 9 device.

Returns:
Returns the parameters used to create the DirectX 9 device.
LSE_INLINE LSG_CULL_MODES LSE_CALL lsg::CDirectX9::GetCullMode ( ) [static]

Gets the cull winding order.

Returns:
Returns the current cull mode.
LSE_INLINE IDirect3DSurface9 *LSE_CALL lsg::CDirectX9::GetDepthStencilSurface ( ) [static]

Gets the depth/stencil surface pointer.

Returns:
Returns the depth/stencil surface pointer.
LSE_INLINE const D3DCAPS9 &LSE_CALL lsg::CDirectX9::GetDeviceCaps ( ) [static]

Gets the device caps.

Returns:
Returns the device caps for read only.
LSE_INLINE IDirect3DDevice9 * lsg::CDirectX9::GetDirectX9Device ( ) [static]

Gets the DirectX 9 device.

Returns:
Returns the DirectX 9 device.
LSE_INLINE IDirect3D9 * lsg::CDirectX9::GetDirectX9Object ( ) [static]

Gets the DirectX 9 object.

Returns:
Returns the DirectX 9 object.
LSE_INLINE const D3DPRESENT_PARAMETERS &LSE_CALL lsg::CDirectX9::GetPresentParms ( ) [static]

Gets the presentation parameters.

Returns:
Returns the presentation parameters used to create the window.
static CShader* LSE_FCALL lsg::CDirectX9::GetShader ( ) [static]

Gets the current shader. If no shader is set, NULL is returned.

Returns:
Returns the current shader or NULL.
LSE_INLINE CShaderManager *LSE_FCALL lsg::CDirectX9::GetShaderManager ( ) [static]

Gets a pointer to the shader manager.

Returns:
Returns a pointer to the shader manager used by this class.
static LSBOOL LSE_CALL lsg::CDirectX9::InitDirectX9 ( LPCLSG_DIRECTX9_INIT  _lpdiInit) [static]

Initialize DirectX 9.

Parameters:
_lpdiInitData required to initialize the device.
Returns:
Returns false if there are any problem during initialization.
static LSVOID LSE_CALL lsg::CDirectX9::LoseDevice ( ) [static]

Called when a device is lost.

LSE_INLINE LSBOOL LSE_CALL lsg::CDirectX9::NonPo2 ( ) [static]

Are non-power-of-2 textures supported?

Returns:
Returns true if non-power-of-2 textures supported.
static CMatrix4x4 LSE_CALL lsg::CDirectX9::OffsetOrtho ( LSREAL  _fLeft,
LSREAL  _fRight,
LSREAL  _fBottom,
LSREAL  _fTop,
LSREAL  _fNear,
LSREAL  _fFar 
) [static]

Creates an orthogonal matrix that accounts for any pixel offsets considered by the API. For example, in OpenGL, [0,0] reads the upper-left corner of the pixel, whereas in Direct3D 9 it reads the center of the pixel.

Parameters:
_tLeftMinimum x-value of the view volume.
_tRightMaximum x-value of the view volume.
_tBottomMinimum y-value of the view volume.
_tTopMaximum y-value of the view volume.
_tNearMinimum z-value of the view volume.
_tFarMaximum z-value of the view volume.
Returns:
Returns the offset orthogonal matrix suitable for blitting to the screen.
static LSVOID LSE_CALL lsg::CDirectX9::PostInitDirectX9 ( ) [static]

Secondary initialization of DirectX 9, after a device has been created.

static LSVOID LSE_CALL lsg::CDirectX9::PreRender ( ) [static]

Called just before rendering to allow performing of any final tasks.

LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::Present ( ) [static]

Present the backbuffer to the screen.

static LSBOOL LSE_CALL lsg::CDirectX9::ResetDevice ( ) [static]

Reset the device.

static LSVOID LSE_CALL lsg::CDirectX9::ResetInternal ( ) [static, protected]

Release all resources and reset our internal state.

template<typename tnType >
LSE_INLINE LSVOID LSE_CALL lsg::CDirectX9::SafeRelease ( tnType &  _tObj) [static]

Safely release an object.

Parameters:
_tObjThe object to release.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetAnisotropy ( LSUINT32  _ui32Slot,
LSUINT32  _ui32Level 
) [static]

Sets the level of anisotropy on a given texture unit.

Parameters:
_ui32SlotSlot in which to set the level of anisotropy.
_ui32LevelThe amount of anisotropy.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetBlendEnabled ( LSBOOL  _bVal) [static]

Enable or disable blending with the backbuffer.

Parameters:
_bValWhether blending with the backbuffer is enabled or disabled.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetBlendFunc ( LSG_BLEND_MODES  _bmSrc,
LSG_BLEND_MODES  _bmDst 
) [static]

Sets the blend functions for the source (color output from a shader) and destination (the current backbuffer).

Parameters:
_bmSrcThe source blend function.
_bmDstThe destination blend function.
static LSVOID LSE_CALL lsg::CDirectX9::SetClearColor ( LSREAL  _fR,
LSREAL  _fG,
LSREAL  _fB,
LSREAL  _fA 
) [static]

Sets the clear color.

Parameters:
_fRRed value.
_fGGreen value.
_fBBlue value.
_fAAlpha value.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetClearDepth ( LSREAL  _fValue) [static]

Sets the depth clear value.

Parameters:
_fValueThe new depth clear value.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetCulling ( LSBOOL  _bVal) [static]

Sets culling to on or off.

Parameters:
_bValWhether culling is enabled or disabled.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetCullMode ( LSG_CULL_MODES  _cmMode) [static]

Sets the cull winding order.

Parameters:
_cmModeThe cull winding.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetDepthFunc ( LSG_DEPTH_TEST  _dtFunc) [static]

Sets the depth-test function.

Parameters:
_dtFuncThe depth-test function to set.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetDepthTest ( LSBOOL  _bVal) [static]

Sets depth testing to on or off.

Parameters:
_bValWhether depth testing is enabled or disabled.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetDepthWrite ( LSBOOL  _bVal) [static]

Sets depth writing to on or off.

Parameters:
_bValWhether depth writing is enabled or disabled.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetFillMode ( LSG_FILL_MODES  _fmMode) [static]

Sets the fill mode.

Parameters:
_fmModeThe fill mode to set.
static LSVOID LSE_CALL lsg::CDirectX9::SetInitialValues ( ) [static]

Sets all states back to their initial values.

LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetMinMagMipFilters ( LSUINT32  _ui32Slot,
D3DTEXTUREFILTERTYPE  _tftMin,
D3DTEXTUREFILTERTYPE  _tftMag,
D3DTEXTUREFILTERTYPE  _tftMip 
) [static]

Sets the min, mag, and mip filters.

Parameters:
_ui32SlotSlot in which to set the filters.
_tftMinMinification filter to set.
_tftMagMagnification filter to set.
_tftMipMipmap filter to set.
static LSVOID LSE_CALL lsg::CDirectX9::SetScreenSize ( LSUINT32  _ui32Width,
LSUINT32  _ui32Height 
) [static]

Sets the screen dimensions.

Parameters:
_ui32WidthScreen width, in pixels.
_ui32HeightScreen height, in pixels.
static LSVOID LSE_FCALL lsg::CDirectX9::SetShader ( CShader _psShader) [static]

Sets the current shader. A shader must be set in order to render.

Parameters:
_psShaderThe shader to use for the current render. NULL is a valid value, but rendering without a shader is not permitted.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetTextureWrapModes ( LSUINT32  _ui32Slot,
D3DTEXTUREADDRESS  _taU,
D3DTEXTUREADDRESS  _taV 
) [static]

Sets the texture wrapping modes for a given slot.

Parameters:
_ui32SlotSlot in which to set the texture wrapping modes.
_taUThe U wrapping mode.
_taVThe V wrapping mode.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetViewport ( LSINT32  _i32X,
LSINT32  _i32Y,
LSINT32  _i32Width,
LSINT32  _i32Height 
) [static]

Sets the viewport dimensions.

Parameters:
_i32XX component of the lower-left view rectangle in pixels. Defaults to 0.
_i32YY component of the lower-left view rectangle in pixels. Defaults to 0.
_i32WidthWidth of the viewport.
_i32HeightHeight of the viewport.
LSE_INLINE LSVOID LSE_CALL lsg::CDirectX9::SetWindowParms ( LSBOOL  _bWindowed,
HWND  _hWnd 
) [static]

Sets the screen settings. Used when toggling fullscreen mode.

Parameters:
_bWindowedWindowed mode?
_hWndNew window handle.
LSE_INLINE LSVOID LSE_CALL lsg::CDirectX9::TogglingFullScreen ( LSBOOL  _bVal) [static]

Sets whether we are toggling full-screen now.

Parameters:
_bValWhether full-screen is being toggled or not.

Member Data Documentation

LSBOOL lsg::CDirectX9::m_bCulling [static, protected]

Is culling enabled?

LSBOOL lsg::CDirectX9::m_bDepthTest [static, protected]

Is depth testing enabled?

LSBOOL lsg::CDirectX9::m_bDeviceLost [static, protected]

Is our device lost?

LSBOOL lsg::CDirectX9::m_bToggling [static, protected]

Are we toggling full-screen?

D3DCAPS9 lsg::CDirectX9::m_cCaps [static, protected]

The device capabilities.

The culling mode.

IDirect3D9* lsg::CDirectX9::m_d3dObject [static, protected]

The DirectX 9 object.

D3DDEVICE_CREATION_PARAMETERS lsg::CDirectX9::m_dcpCreationParms [static, protected]

Device creation parameters.

LSFLOAT lsg::CDirectX9::m_fDepthClear [static, protected]

The depth clear value.

LSINT32 lsg::CDirectX9::m_i32VertProcType [static, protected]

D3DCREATE_HARDWARE_VERTEXPROCESSING or D3DCREATE_SOFTWARE_VERTEXPROCESSING.

IDirect3DDevice9* lsg::CDirectX9::m_pd3dDevice [static, protected]

The DirectX 9 device.

IDirect3DSurface9* lsg::CDirectX9::m_pd3s9Back [static, protected]

The back buffer surface.

IDirect3DSurface9* lsg::CDirectX9::m_pd3s9DepthStencil [static, protected]

The main depth/stencil buffer.

D3DPRESENT_PARAMETERS lsg::CDirectX9::m_ppPresentParms [static, protected]

The last presentation parameters we used.

The shader manager.

D3DTEXTUREADDRESS lsg::CDirectX9::m_taWrapU[LSG_MAX_TEXTURE_UNITS] [static, protected]

The current texture wrap mode for the U.

D3DTEXTUREADDRESS lsg::CDirectX9::m_taWrapV[LSG_MAX_TEXTURE_UNITS] [static, protected]

The current texture wrap mode for the V.

D3DTEXTUREFILTERTYPE lsg::CDirectX9::m_tftMagFilter[LSG_MAX_TEXTURE_UNITS] [static, protected]

The current magnification filter.

D3DTEXTUREFILTERTYPE lsg::CDirectX9::m_tftMinFilter[LSG_MAX_TEXTURE_UNITS] [static, protected]

The current minification filter.

D3DTEXTUREFILTERTYPE lsg::CDirectX9::m_tftMipFilter[LSG_MAX_TEXTURE_UNITS] [static, protected]

The current mipmap filter.

LSUINT32 lsg::CDirectX9::m_ui32AnisoLevel[LSG_MAX_TEXTURE_UNITS] [static, protected]

The current anisotropy level.

LSUINT32 lsg::CDirectX9::m_ui32ClearColor [static, protected]

The clear color, stored in a single 32-bit value. ARGB order.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator