Isle
Loading...
Searching...
No Matches
MxDeviceEnumerate Class Reference

[AI] Enumerates DirectDraw/Direct3D drivers, devices, and display modes on the system. More...

#include <mxdirectxinfo.h>

Inheritance diagram for MxDeviceEnumerate:
Collaboration diagram for MxDeviceEnumerate:

Classes

struct  GUID4
 [AI] Utility structure for GUID comparison. More...
 

Public Member Functions

 MxDeviceEnumerate ()
 [AI] Constructs an MxDeviceEnumerate object, sets initialized flag to FALSE. More...
 
 ~MxDeviceEnumerate ()
 [AI] Destructor. More...
 
virtual int DoEnumerate ()
 [AI] Begins enumeration of DirectDraw drivers, their devices, and available display modes. More...
 
BOOL EnumDirectDrawCallback (LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
 [AI] Callback for enumerating a single DirectDraw driver. More...
 
HRESULT EnumDisplayModesCallback (LPDDSURFACEDESC p_ddsd)
 [AI] Callback for each display mode in a driver. More...
 
HRESULT EnumDevicesCallback (LPGUID p_guid, LPSTR p_deviceDesc, LPSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc)
 [AI] Callback for enumerating 3D devices on a driver. More...
 
const char * EnumerateErrorToString (HRESULT p_error)
 [AI] Converts a DirectDraw/Direct3D HRESULT enumeration error to a human-readable string. More...
 
const list< MxDriver > & GetDriverList () const
 [AI] Returns a const reference to the list of enumerated drivers/devices/modes. More...
 
unsigned char IsInitialized () const
 [AI] Checks if the enumeration has already been performed. More...
 

Static Public Member Functions

static void BuildErrorString (const char *,...)
 [AI] Utility for formatting and outputting error/debug strings. More...
 
static BOOL CALLBACK DirectDrawEnumerateCallback (LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName, LPVOID p_context)
 [AI] Static thunk callback suitable for passing to DirectDrawEnumerate. More...
 
static HRESULT CALLBACK DisplayModesEnumerateCallback (LPDDSURFACEDESC p_ddsd, LPVOID p_context)
 [AI] Static thunk callback for enumerating display modes during driver enumeration. More...
 
static HRESULT CALLBACK DevicesEnumerateCallback (LPGUID p_guid, LPSTR p_deviceDesc, LPSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc, LPVOID p_context)
 [AI] Static thunk callback for enumerating 3D devices within a driver. More...
 

Protected Attributes

list< MxDriverm_list
 [AI] List of all discovered DirectDraw drivers and their device/mode info. More...
 
unsigned char m_initialized
 [AI] Set TRUE after successful enumeration to prevent redundant operations. More...
 

Friends

class MxDirect3D
 

Detailed Description

[AI] Enumerates DirectDraw/Direct3D drivers, devices, and display modes on the system.

[AI] Used to collect and expose lists of graphics drivers, 3D devices, and supported modes for device selection and initialization.

Definition at line 269 of file mxdirectxinfo.h.

Constructor & Destructor Documentation

◆ MxDeviceEnumerate()

MxDeviceEnumerate::MxDeviceEnumerate ( )

[AI] Constructs an MxDeviceEnumerate object, sets initialized flag to FALSE.

Definition at line 182 of file mxdirectxinfo.cpp.

◆ ~MxDeviceEnumerate()

MxDeviceEnumerate::~MxDeviceEnumerate ( )

[AI] Destructor.

No dynamic resource management.

Definition at line 190 of file mxdirectxinfo.cpp.

Member Function Documentation

◆ BuildErrorString()

void MxDeviceEnumerate::BuildErrorString ( const char *  p_format,
  ... 
)
static

[AI] Utility for formatting and outputting error/debug strings.

Parameters
...printf-style format/varargs. [AI]

Definition at line 260 of file mxdirectxinfo.cpp.

◆ DevicesEnumerateCallback()

HRESULT CALLBACK MxDeviceEnumerate::DevicesEnumerateCallback ( LPGUID  p_guid,
LPSTR  p_deviceDesc,
LPSTR  p_deviceName,
LPD3DDEVICEDESC  p_HWDesc,
LPD3DDEVICEDESC  p_HELDesc,
LPVOID  p_context 
)
static

[AI] Static thunk callback for enumerating 3D devices within a driver.

Parameters
p_guidDevice GUID. [AI]
p_deviceDescDevice description string. [AI]
p_deviceNameDevice name string. [AI]
p_HWDescHardware device capabilities. [AI]
p_HELDescSoftware (HEL) capabilities. [AI]
p_contextPointer to this instance. [AI]
Returns
DDENUMRET_OK. [AI]

Definition at line 287 of file mxdirectxinfo.cpp.

◆ DirectDrawEnumerateCallback()

BOOL CALLBACK MxDeviceEnumerate::DirectDrawEnumerateCallback ( LPGUID  p_guid,
LPSTR  p_driverDesc,
LPSTR  p_driverName,
LPVOID  p_context 
)
static

[AI] Static thunk callback suitable for passing to DirectDrawEnumerate.

Parameters
p_guidGUID pointer to the driver. [AI]
p_driverDescDescription string provided by DirectDraw. [AI]
p_driverNameName string provided by DirectDraw. [AI]
p_contextpointer to this instance. [AI]
Returns
TRUE; always continues enumeration. [AI]

Definition at line 358 of file mxdirectxinfo.cpp.

◆ DisplayModesEnumerateCallback()

HRESULT CALLBACK MxDeviceEnumerate::DisplayModesEnumerateCallback ( LPDDSURFACEDESC  p_ddsd,
LPVOID  p_context 
)
static

[AI] Static thunk callback for enumerating display modes during driver enumeration.

Parameters
p_ddsdSurface description for the display mode. [AI]
p_contextpointer to this instance. [AI]
Returns
DDENUMRET_OK. [AI]

Definition at line 275 of file mxdirectxinfo.cpp.

◆ DoEnumerate()

int MxDeviceEnumerate::DoEnumerate ( )
virtual

[AI] Begins enumeration of DirectDraw drivers, their devices, and available display modes.

[AI] This will populate m_list with all available drivers/devices/modes and set m_initialized to TRUE if successful.

Returns
0 on success, -1 if already initialized or on error [AI].

Definition at line 338 of file mxdirectxinfo.cpp.

◆ EnumDevicesCallback()

HRESULT MxDeviceEnumerate::EnumDevicesCallback ( LPGUID  p_guid,
LPSTR  p_deviceDesc,
LPSTR  p_deviceName,
LPD3DDEVICEDESC  p_HWDesc,
LPD3DDEVICEDESC  p_HELDesc 
)

[AI] Callback for enumerating 3D devices on a driver.

Parameters
p_guidDevice GUID. [AI]
p_deviceDescDescription string from the API. [AI]
p_deviceNameName string from the API. [AI]
p_HWDescHardware capabilities. [AI]
p_HELDescHEL (software) capabilities. [AI]
Returns
DDENUMRET_OK. [AI]

Definition at line 321 of file mxdirectxinfo.cpp.

◆ EnumDirectDrawCallback()

BOOL MxDeviceEnumerate::EnumDirectDrawCallback ( LPGUID  p_guid,
LPSTR  p_driverDesc,
LPSTR  p_driverName 
)

[AI] Callback for enumerating a single DirectDraw driver.

Parameters
p_guidGUID of driver. [AI]
p_driverDescDescription string from DirectDraw. [AI]
p_driverNameName string from DirectDraw. [AI]
Returns
TRUE (continue), used during enumeration. [AI]

Definition at line 197 of file mxdirectxinfo.cpp.

◆ EnumDisplayModesCallback()

HRESULT MxDeviceEnumerate::EnumDisplayModesCallback ( LPDDSURFACEDESC  p_ddsd)

[AI] Callback for each display mode in a driver.

Parameters
p_ddsdSurface description structure for the display mode. [AI]
Returns
DDENUMRET_OK. [AI]

Definition at line 307 of file mxdirectxinfo.cpp.

◆ EnumerateErrorToString()

const char * MxDeviceEnumerate::EnumerateErrorToString ( HRESULT  p_error)

[AI] Converts a DirectDraw/Direct3D HRESULT enumeration error to a human-readable string.

Parameters
p_errorHRESULT error value returned during enumeration. [AI]
Returns
Human-readable error description. [AI]

Definition at line 370 of file mxdirectxinfo.cpp.

◆ GetDriverList()

const list< MxDriver > & MxDeviceEnumerate::GetDriverList ( ) const
inline

[AI] Returns a const reference to the list of enumerated drivers/devices/modes.

Returns
Const list reference. [AI]

Definition at line 377 of file mxdirectxinfo.h.

◆ IsInitialized()

unsigned char MxDeviceEnumerate::IsInitialized ( ) const
inline

[AI] Checks if the enumeration has already been performed.

Returns
TRUE if initialized/enumerated, FALSE if not. [AI]

Definition at line 407 of file mxdirectxinfo.h.

Friends And Related Function Documentation

◆ MxDirect3D

friend class MxDirect3D
friend

Definition at line 371 of file mxdirectxinfo.h.

Member Data Documentation

◆ m_initialized

unsigned char MxDeviceEnumerate::m_initialized
protected

[AI] Set TRUE after successful enumeration to prevent redundant operations.

Definition at line 411 of file mxdirectxinfo.h.

◆ m_list

list<MxDriver> MxDeviceEnumerate::m_list
protected

[AI] List of all discovered DirectDraw drivers and their device/mode info.

Definition at line 410 of file mxdirectxinfo.h.


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