"L. Spiro Engine"
|
Interface with the DirectX 9 API. More...
#include <LSGDirectX9.h>
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 CShaderManager * | m_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] |
Interface with the DirectX 9 API.
Class CDirectX9 Description: Interface with the DirectX 9 API.
typedef struct lsg::CDirectX9::LSG_DIRECTX9_INIT * lsg::CDirectX9::LPLSG_DIRECTX9_INIT |
Data needed to initialize the device.
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.
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::Clear | ( | LSUINT32 | _ui32Mask | ) | [static] |
Clear the active buffer of the given type(s).
_ui32Mask | The 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.
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.
LSE_INLINE const D3DDEVICE_CREATION_PARAMETERS & lsg::CDirectX9::GetCreationParms | ( | ) | [static] |
Gets 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.
LSE_INLINE IDirect3DSurface9 *LSE_CALL lsg::CDirectX9::GetDepthStencilSurface | ( | ) | [static] |
Gets the depth/stencil surface pointer.
LSE_INLINE const D3DCAPS9 &LSE_CALL lsg::CDirectX9::GetDeviceCaps | ( | ) | [static] |
Gets the device caps.
LSE_INLINE IDirect3DDevice9 * lsg::CDirectX9::GetDirectX9Device | ( | ) | [static] |
Gets the DirectX 9 device.
LSE_INLINE IDirect3D9 * lsg::CDirectX9::GetDirectX9Object | ( | ) | [static] |
Gets the DirectX 9 object.
LSE_INLINE const D3DPRESENT_PARAMETERS &LSE_CALL lsg::CDirectX9::GetPresentParms | ( | ) | [static] |
Gets the presentation parameters.
static CShader* LSE_FCALL lsg::CDirectX9::GetShader | ( | ) | [static] |
Gets the current shader. If no shader is set, NULL is returned.
LSE_INLINE CShaderManager *LSE_FCALL lsg::CDirectX9::GetShaderManager | ( | ) | [static] |
Gets a pointer to the shader manager.
static LSBOOL LSE_CALL lsg::CDirectX9::InitDirectX9 | ( | LPCLSG_DIRECTX9_INIT | _lpdiInit | ) | [static] |
Initialize DirectX 9.
_lpdiInit | Data required to initialize the device. |
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?
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.
_tLeft | Minimum x-value of the view volume. |
_tRight | Maximum x-value of the view volume. |
_tBottom | Minimum y-value of the view volume. |
_tTop | Maximum y-value of the view volume. |
_tNear | Minimum z-value of the view volume. |
_tFar | Maximum z-value of the view volume. |
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.
LSE_INLINE LSVOID LSE_CALL lsg::CDirectX9::SafeRelease | ( | tnType & | _tObj | ) | [static] |
Safely release an object.
_tObj | The 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.
_ui32Slot | Slot in which to set the level of anisotropy. |
_ui32Level | The amount of anisotropy. |
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetBlendEnabled | ( | LSBOOL | _bVal | ) | [static] |
Enable or disable blending with the backbuffer.
_bVal | Whether 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).
_bmSrc | The source blend function. |
_bmDst | The destination blend function. |
static LSVOID LSE_CALL lsg::CDirectX9::SetClearColor | ( | LSREAL | _fR, |
LSREAL | _fG, | ||
LSREAL | _fB, | ||
LSREAL | _fA | ||
) | [static] |
Sets the clear color.
_fR | Red value. |
_fG | Green value. |
_fB | Blue value. |
_fA | Alpha value. |
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetClearDepth | ( | LSREAL | _fValue | ) | [static] |
Sets the depth clear value.
_fValue | The new depth clear value. |
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetCulling | ( | LSBOOL | _bVal | ) | [static] |
Sets culling to on or off.
_bVal | Whether culling is enabled or disabled. |
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetCullMode | ( | LSG_CULL_MODES | _cmMode | ) | [static] |
Sets the cull winding order.
_cmMode | The cull winding. |
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetDepthFunc | ( | LSG_DEPTH_TEST | _dtFunc | ) | [static] |
Sets the depth-test function.
_dtFunc | The depth-test function to set. |
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetDepthTest | ( | LSBOOL | _bVal | ) | [static] |
Sets depth testing to on or off.
_bVal | Whether depth testing is enabled or disabled. |
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetDepthWrite | ( | LSBOOL | _bVal | ) | [static] |
Sets depth writing to on or off.
_bVal | Whether depth writing is enabled or disabled. |
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetFillMode | ( | LSG_FILL_MODES | _fmMode | ) | [static] |
Sets the fill mode.
_fmMode | The 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.
_ui32Slot | Slot in which to set the filters. |
_tftMin | Minification filter to set. |
_tftMag | Magnification filter to set. |
_tftMip | Mipmap filter to set. |
static LSVOID LSE_CALL lsg::CDirectX9::SetScreenSize | ( | LSUINT32 | _ui32Width, |
LSUINT32 | _ui32Height | ||
) | [static] |
Sets the screen dimensions.
_ui32Width | Screen width, in pixels. |
_ui32Height | Screen 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.
_psShader | The 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.
_ui32Slot | Slot in which to set the texture wrapping modes. |
_taU | The U wrapping mode. |
_taV | The V wrapping mode. |
LSE_INLINE LSVOID LSE_FCALL lsg::CDirectX9::SetViewport | ( | LSINT32 | _i32X, |
LSINT32 | _i32Y, | ||
LSINT32 | _i32Width, | ||
LSINT32 | _i32Height | ||
) | [static] |
Sets the viewport dimensions.
_i32X | X component of the lower-left view rectangle in pixels. Defaults to 0. |
_i32Y | Y component of the lower-left view rectangle in pixels. Defaults to 0. |
_i32Width | Width of the viewport. |
_i32Height | Height 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.
_bWindowed | Windowed mode? |
_hWnd | New window handle. |
LSE_INLINE LSVOID LSE_CALL lsg::CDirectX9::TogglingFullScreen | ( | LSBOOL | _bVal | ) | [static] |
Sets whether we are toggling full-screen now.
_bVal | Whether full-screen is being toggled or not. |
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.
LSG_CULL_MODES lsg::CDirectX9::m_cmCullMode [static, protected] |
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.
CShaderManager* lsg::CDirectX9::m_psmShaderMan [static, protected] |
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.