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

#include <cDXBase.h>

Inheritance diagram for Gray3D::cDXBase:
Gray3D::cDXDevice Gray3D::cDXRenderBatch Gray3D::cDXTextureBase Gray3D::cXTextureMgr GrayGUI::cXWindow GrayGUI::cXDesktopMgr Gray3D::cDXTexture Gray3D::cXTextureFile GrayGUI::cXColorGrid GrayGUI::cXComboBox GrayGUI::cXImage GrayGUI::cXProgressBar GrayGUI::cXScrollBar GrayGUI::cXSpinCounter GrayGUI::cXStaticMultiScroll GrayGUI::cXWindowText

Public Member Functions

 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)
 

Public Attributes

cDXDevicem_pDXDev
 What device is this attached to (or should be)? InitDeviceObjects() was called and DeleteDeviceObjects() was not. More...
 
cIUnkPtr< ID3DDevicem_pD3DDev
 

Detailed Description

A resource object that is also (maybe) DirectX related/managed, attached to a cDXDevice. (and can be lost/disposed). or has children that do. Base class for the object that manages the DX interface pointer. (may not be actually rendered object). e.g. cXTextureMgr, cDXFont, cDXGPUVert, cDXRenderBatch, cDXSpriteDC, cDXTextureBase May have SetPrivateData

Constructor & Destructor Documentation

◆ cDXBase()

Gray3D::cDXBase::cDXBase ( cDXDevice pDXDev = nullptr)
noexcept

◆ ~cDXBase()

Gray3D::cDXBase::~cDXBase ( )
virtual

Assume DeleteDeviceObjects was called??

Member Function Documentation

◆ DeleteDeviceObjects()

HRESULT Gray3D::cDXBase::DeleteDeviceObjects ( )
virtual

◆ get_D3DDev()

ID3DDevice* Gray3D::cDXBase::get_D3DDev ( ) const
inlinenoexcept

Get the device but only if active. Dont call this if the device is Lost.

◆ InitDeviceObjects()

HRESULT Gray3D::cDXBase::InitDeviceObjects ( cDXDevice pDXDev)
virtual

Created my DX interface/object and attached it to a IDirect3DDevice9

Reimplemented in GrayGUI::cXWindowText, GrayGUI::cXWindow, Gray3D::cXTextureFile, and Gray3D::cDXTexture.

◆ isInitDevice()

bool Gray3D::cDXBase::isInitDevice ( ) const
inlinenoexcept

has InitDeviceObjects() been called?

◆ isLostDevice()

bool Gray3D::cDXBase::isLostDevice ( ) const
inlinenoexcept

Device is lost. Wait for ResetDevice to be called.

◆ OnLostDeviceX()

HRESULT Gray3D::cDXBase::OnLostDeviceX ( void  )
virtual

We have lost (or are going to lose) control of the device. Assume anything cached in its memory is gone. ASSUME ID3DDevice->Reset() will be called or we got D3DERR_DEVICELOST. Assume Vertex buffers, textures, etc are lost. release them. Call OnLostDevice() on appropriate interfaces.

Reimplemented in GrayGUI::cXWindowText, GrayGUI::cXWindow, GrayGUI::cXDesktopMgr, GrayGUI::cXImage, and GrayGUI::cXColorGrid.

◆ OnResetDeviceX()

HRESULT Gray3D::cDXBase::OnResetDeviceX ( void  )
virtual

Reload/Restore resources to the ID3DDevice/IDirect3DDevice9 memory. call OnResetDevice() on appropriate interfaces. must reload vertex buffers and textures.

Reimplemented in GrayGUI::cXWindowText, GrayGUI::cXWindow, GrayGUI::cXDialog, and GrayGUI::cXDesktopMgr.

◆ UNITTEST_FRIEND()

Gray3D::cDXBase::UNITTEST_FRIEND ( cDXBase  )

Member Data Documentation

◆ m_pD3DDev

cIUnkPtr<ID3DDevice> Gray3D::cDXBase::m_pD3DDev

◆ m_pDXDev

cDXDevice* Gray3D::cDXBase::m_pDXDev

What device is this attached to (or should be)? InitDeviceObjects() was called and DeleteDeviceObjects() was not.

Set to nullptr on OnLostDeviceX() because we are calling ID3DDevice->Reset() or got D3DERR_DEVICELOST. assume resource is disposed.


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