Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray3D::cDXDevice Class Reference

#include <cDXDevice.h>

Inheritance diagram for Gray3D::cDXDevice:
Gray3D::cDXBase

Public Member Functions

 cDXDevice (ID3DDevice *pD3DDev=nullptr)
 
 ~cDXDevice ()
 
HRESULT CreateDeviceDummy ()
 
HRESULT CreateDeviceWindowed (HWND hWnd)
 
cIUnkPtr< ID3DSurfaceCreateDeviceCursor (const ICONINFO &iconinfo, bool bAddWatermark)
 
HRESULT SetDeviceCursor (HCURSOR hCursor, bool bAddWatermark)
 
- Public Member Functions inherited from Gray3D::cDXBase
 cDXBase (cDXDevice *pDXDev=nullptr) noexcept
 
virtual ~cDXBase ()
 
ID3DDeviceget_D3DDev () const noexcept
 
bool isInitDevice () const noexcept
 
bool isLostDevice () const noexcept
 
virtual HRESULT InitDeviceObjects (cDXDevice *pDXDev)
 
virtual HRESULT OnResetDeviceX ()
 
virtual HRESULT OnLostDeviceX ()
 
virtual HRESULT DeleteDeviceObjects ()
 
 UNITTEST_FRIEND (cDXBase)
 

Static Public Member Functions

static cString GRAYCALL GetErrorMessage (HRESULT hRes)
 
static const GChar_t *GRAYCALL GetD3DFormatStr0 (D3DFORMAT format)
 
static cString GRAYCALL GetD3DFormatStr (D3DFORMAT format)
 
static const GChar_t *GRAYCALL GetD3DMultisampleStr (D3DMULTISAMPLE_TYPE n)
 
static const GChar_t *GRAYCALL D3DDevTypeToString (D3DDEVTYPE devType)
 
static const GChar_t *GRAYCALL MultisampleTypeToString (D3DMULTISAMPLE_TYPE MultiSampleType)
 
static const GChar_t *GRAYCALL PresentIntervalToString (UINT pi)
 

Public Attributes

cIUnkPtr< ID3DDevicem_pD3DDev
 
cXTextureMgrm_pTexMgr
 Manage/cache all the textures loaded for this device. Can be stored on the device or in system memory. More...
 
- Public Attributes inherited from Gray3D::cDXBase
cDXDevicem_pDXDev
 What device is this attached to (or should be)? InitDeviceObjects() was called and DeleteDeviceObjects() was not. More...
 
cIUnkPtr< ID3DDevicem_pD3DDev
 

Detailed Description

Wrap a ID3DDevice/IDirect3DDevice9. Manage all the stuff attached to the D3D device.

Constructor & Destructor Documentation

◆ cDXDevice()

Gray3D::cDXDevice::cDXDevice ( ID3DDevice pD3DDev = nullptr)

◆ ~cDXDevice()

Gray3D::cDXDevice::~cDXDevice ( )

Member Function Documentation

◆ CreateDeviceCursor()

cIUnkPtr< ID3DSurface > Gray3D::cDXDevice::CreateDeviceCursor ( const ICONINFO &  iconinfo,
bool  bAddWatermark 
)

Create a IDirect3DSurface9 for the windows cursor/icon. for fullscreen mode. TODO Merge. Similar to SetWindowsIcon()

◆ CreateDeviceDummy()

HRESULT Gray3D::cDXDevice::CreateDeviceDummy ( )

will create "dummy" Direct3d device, just to do software processing, for stand-alone compiler for example it will require only DirectX on target machine, but no actual 3d accelerator will be required D3DERR_INVALIDDEVICE

◆ CreateDeviceWindowed()

HRESULT Gray3D::cDXDevice::CreateDeviceWindowed ( HWND  hWnd)

Create a ID3DDevice/IDirect3DDevice9 that is compatible with the current desktop. Windowed mode. Link IDirect3DDevice9 to a HWND

  • hWnd = HWND_DESKTOP is OK

◆ D3DDevTypeToString()

const GChar_t *GRAYCALL Gray3D::cDXDevice::D3DDevTypeToString ( D3DDEVTYPE  devType)
static

Returns the string for the given D3DDEVTYPE.

◆ GetD3DFormatStr()

cString GRAYCALL Gray3D::cDXDevice::GetD3DFormatStr ( D3DFORMAT  format)
static

Returns the string for the given D3DFORMAT. string should include the "D3DFMT_" prefix

Returns
the string for the given D3DFORMAT.

◆ GetD3DFormatStr0()

const GChar_t *GRAYCALL Gray3D::cDXDevice::GetD3DFormatStr0 ( D3DFORMAT  format)
static

◆ GetD3DMultisampleStr()

const GChar_t *GRAYCALL Gray3D::cDXDevice::GetD3DMultisampleStr ( D3DMULTISAMPLE_TYPE  n)
static

◆ GetErrorMessage()

cString GRAYCALL Gray3D::cDXDevice::GetErrorMessage ( HRESULT  hRes)
static

◆ MultisampleTypeToString()

const GChar_t *GRAYCALL Gray3D::cDXDevice::MultisampleTypeToString ( D3DMULTISAMPLE_TYPE  MultiSampleType)
static

Returns the string for the given D3DMULTISAMPLE_TYPE.

◆ PresentIntervalToString()

const GChar_t *GRAYCALL Gray3D::cDXDevice::PresentIntervalToString ( UINT  pi)
static

Returns the string for the given present interval.

◆ SetDeviceCursor()

HRESULT Gray3D::cDXDevice::SetDeviceCursor ( HCURSOR  hCursor,
bool  bAddWatermark 
)

Builds and sets a cursor for the D3D device based on hCursor. Gives the D3D device a cursor with image and hotspot from hCursor. Should cache this ??

Member Data Documentation

◆ m_pD3DDev

cIUnkPtr<ID3DDevice> Gray3D::cDXDevice::m_pD3DDev

◆ m_pTexMgr

cXTextureMgr* Gray3D::cDXDevice::m_pTexMgr

Manage/cache all the textures loaded for this device. Can be stored on the device or in system memory.


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