Isle
Loading...
Searching...
No Matches
mxdirectxinfo.h
Go to the documentation of this file.
1#ifndef MXDIRECTXINFO_H
2#define MXDIRECTXINFO_H
3
4#include "decomp.h"
5#include "mxstl/stlcompat.h"
6
7#include <d3d.h>
8
9// SIZE 0x17c
22 struct Mode {
28 int operator==(const Mode& p_mode) const
29 {
30 return ((width == p_mode.width) && (height == p_mode.height) && (bitsPerPixel == p_mode.bitsPerPixel));
31 }
32
33 int width;
34 int height;
36 };
37
42
47
48 GUID* m_guid;
50 int m_count;
52 void* m_unk0x178;
53
54 // SYNTHETIC: BETA10 0x1011c650
55 // DeviceModesInfo::`scalar deleting destructor'
56};
57
58// SIZE 0xe4
66public:
67 enum {
69 c_primaryDevice = 0x02
70 };
71
80
84 unsigned int GetFlags() { return m_flags; }
88 BOOL GetHardwareMode() { return ((int) m_flags << 31) >> 31; }
92 D3DDEVICEDESC& GetDesc() { return m_desc; }
93
94 friend class MxDirect3D;
95
96 // SYNTHETIC: BETA10 0x1011c130
97 // MxAssignedDevice::`scalar deleting destructor'
98
99private:
100 GUID m_guid;
101 unsigned int m_flags;
102 D3DDEVICEDESC m_desc;
103 DeviceModesInfo* m_deviceInfo;
104};
105
106// SIZE 0x1a4
130 LPGUID p_guid,
131 LPSTR p_deviceDesc,
132 LPSTR p_deviceName,
133 LPD3DDEVICEDESC p_HWDesc,
134 LPD3DDEVICEDESC p_HELDesc
135 );
136
145 void Initialize(
146 LPGUID p_guid,
147 LPSTR p_deviceDesc,
148 LPSTR p_deviceName,
149 LPD3DDEVICEDESC p_HWDesc,
150 LPD3DDEVICEDESC p_HELDesc
151 );
152
153 LPGUID m_guid;
158
162 int operator==(Direct3DDeviceInfo) const { return 0; }
166 int operator<(Direct3DDeviceInfo) const { return 0; }
167};
168
169// SIZE 0x0c
186 MxDisplayMode(DWORD p_width, DWORD p_height, DWORD p_bitsPerPixel)
187 {
188 m_width = p_width;
189 m_height = p_height;
190 m_bitsPerPixel = p_bitsPerPixel;
191 }
192
196 int operator==(MxDisplayMode) const { return 0; }
200 int operator<(MxDisplayMode) const { return 0; }
201
205};
206
207// SIZE 0x190
213struct MxDriver {
221 ~MxDriver();
226 MxDriver(LPGUID p_guid);
233 MxDriver(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName);
234
241 void Init(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName);
242
243 LPGUID m_guid;
247 list<Direct3DDeviceInfo> m_devices;
248 list<MxDisplayMode> m_displayModes;
249
253 int operator==(MxDriver) const { return 0; }
257 int operator<(MxDriver) const { return 0; }
258};
259
260// VTABLE: CONFIG 0x00406000
261// VTABLE: LEGO1 0x100db814
262// VTABLE: BETA10 0x101c1b0c
263// SIZE 0x14
270public:
275
280
286 virtual int DoEnumerate(); // vtable+0x00
287
295 BOOL EnumDirectDrawCallback(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName);
296
303
314 LPGUID p_guid,
315 LPSTR p_deviceDesc,
316 LPSTR p_deviceName,
317 LPD3DDEVICEDESC p_HWDesc,
318 LPD3DDEVICEDESC p_HELDesc
319 );
325 const char* EnumerateErrorToString(HRESULT p_error);
326
331 static void BuildErrorString(const char*, ...);
332
341 static BOOL CALLBACK
342 DirectDrawEnumerateCallback(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName, LPVOID p_context);
343
350 static HRESULT CALLBACK DisplayModesEnumerateCallback(LPDDSURFACEDESC p_ddsd, LPVOID p_context);
351
362 static HRESULT CALLBACK DevicesEnumerateCallback(
363 LPGUID p_guid,
364 LPSTR p_deviceDesc,
365 LPSTR p_deviceName,
366 LPD3DDEVICEDESC p_HWDesc,
367 LPD3DDEVICEDESC p_HELDesc,
368 LPVOID p_context
369 );
370
371 friend class MxDirect3D;
372
377 const list<MxDriver>& GetDriverList() const { return m_list; }
378
384 struct GUID4 {
389
396 static unsigned char Compare(const GUID4& p_a, const GUID4& p_b)
397 {
398 return p_a.m_data1 == p_b.m_data1 && p_a.m_data2 == p_b.m_data2 && p_a.m_data3 == p_b.m_data3 &&
399 p_a.m_data4 == p_b.m_data4;
400 }
401 };
402
407 unsigned char IsInitialized() const { return m_initialized; }
408
409protected:
410 list<MxDriver> m_list;
411 unsigned char m_initialized;
412};
413
414// TEMPLATE: BETA10 0x1011c1b0
415// list<Direct3DDeviceInfo,allocator<Direct3DDeviceInfo> >::iterator::operator*
416
417// TEMPLATE: BETA10 0x1011c200
418// list<Direct3DDeviceInfo,allocator<Direct3DDeviceInfo> >::iterator::operator++
419
420// TEMPLATE: BETA10 0x1011c290
421// list<Direct3DDeviceInfo,allocator<Direct3DDeviceInfo> >::begin
422
423// TEMPLATE: BETA10 0x1011c300
424// list<Direct3DDeviceInfo,allocator<Direct3DDeviceInfo> >::end
425
426// TEMPLATE: BETA10 0x1011c4d0
427// list<MxDriver,allocator<MxDriver> >::iterator::operator*
428
429// TEMPLATE: BETA10 0x1011c520
430// list<MxDriver,allocator<MxDriver> >::iterator::operator++
431
432// TEMPLATE: BETA10 0x1011c560
433// list<MxDriver,allocator<MxDriver> >::iterator::operator++
434
435// TEMPLATE: BETA10 0x1011c590
436// list<MxDriver,allocator<MxDriver> >::_Acc::_Next
437
438// TEMPLATE: BETA10 0x1011c5b0
439// list<MxDriver,allocator<MxDriver> >::begin
440
441// TEMPLATE: BETA10 0x1011c5f0
442// list<MxDriver,allocator<MxDriver> >::iterator::iterator
443
444// TEMPLATE: BETA10 0x1011c620
445// list<MxDriver,allocator<MxDriver> >::end
446
447// TEMPLATE: BETA10 0x1011c690
448// ??9@YAHABViterator@?$list@UMxDriver@@V?$allocator@UMxDriver@@@@@@0@Z
449
450// TEMPLATE: BETA10 0x1011c770
451// ??9@YAHABViterator@?$list@UDirect3DDeviceInfo@@V?$allocator@UDirect3DDeviceInfo@@@@@@0@Z
452
453// TEMPLATE: BETA10 0x1011d3a0
454// list<MxDriver,allocator<MxDriver> >::size
455
456// TEMPLATE: BETA10 0x1011d3c0
457// list<Direct3DDeviceInfo,allocator<Direct3DDeviceInfo> >::size
458
459// TEMPLATE: BETA10 0x1011d3e0
460// list<Direct3DDeviceInfo,allocator<Direct3DDeviceInfo> >::erase
461
462// TEMPLATE: BETA10 0x1011d570
463// list<MxDriver,allocator<MxDriver> >::erase
464
465// TEMPLATE: BETA10 0x1011d6a0
466// list<MxDriver,allocator<MxDriver> >::_Freenode
467
468// TEMPLATE: BETA10 0x1011d700
469// list<MxDriver,allocator<MxDriver> >::front
470
471// TEMPLATE: BETA10 0x1011f750
472// list<MxDriver,allocator<MxDriver> >::back
473
474// TEMPLATE: BETA10 0x1011f780
475// list<MxDriver,allocator<MxDriver> >::iterator::operator--
476
477// TEMPLATE: BETA10 0x1011f7b0
478// list<MxDriver,allocator<MxDriver> >::push_back
479
480// TEMPLATE: BETA10 0x1011f830
481// list<MxDriver,allocator<MxDriver> >::insert
482
483// TEMPLATE: BETA10 0x1011f960
484// list<MxDisplayMode,allocator<MxDisplayMode> >::push_back
485
486// TEMPLATE: BETA10 0x1011fa90
487// list<Direct3DDeviceInfo,allocator<Direct3DDeviceInfo> >::push_back
488
489#endif // MXDIRECTXINFO_H
[AI] Holds assignment and description details for a Direct3D rendering device in use.
Definition: mxdirectxinfo.h:65
@ c_primaryDevice
[AI] Flags the device as the system's primary device.
Definition: mxdirectxinfo.h:69
@ c_hardwareMode
[AI] Indicates that the device is a hardware rendering device.
Definition: mxdirectxinfo.h:68
BOOL GetHardwareMode()
[AI] Checks if the device is operating in hardware mode.
Definition: mxdirectxinfo.h:88
MxAssignedDevice()
[AI] Initializes an empty MxAssignedDevice structure.
D3DDEVICEDESC & GetDesc()
[AI] Accessor for device's current description.
Definition: mxdirectxinfo.h:92
unsigned int GetFlags()
[AI] Returns all flags describing hardware mode/primary device status.
Definition: mxdirectxinfo.h:84
~MxAssignedDevice()
[AI] Destructor; deletes associated DeviceModesInfo.
[AI] Enumerates DirectDraw/Direct3D drivers, devices, and display modes on the system.
unsigned char IsInitialized() const
[AI] Checks if the enumeration has already been performed.
HRESULT EnumDisplayModesCallback(LPDDSURFACEDESC p_ddsd)
[AI] Callback for each display mode in a driver.
~MxDeviceEnumerate()
[AI] Destructor.
BOOL EnumDirectDrawCallback(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
[AI] Callback for enumerating a single DirectDraw driver.
unsigned char m_initialized
[AI] Set TRUE after successful enumeration to prevent redundant operations.
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.
MxDeviceEnumerate()
[AI] Constructs an MxDeviceEnumerate object, sets initialized flag to FALSE.
virtual int DoEnumerate()
[AI] Begins enumeration of DirectDraw drivers, their devices, and available display modes.
list< MxDriver > m_list
[AI] List of all discovered DirectDraw drivers and their device/mode info.
const list< MxDriver > & GetDriverList() const
[AI] Returns a const reference to the list of enumerated drivers/devices/modes.
const char * EnumerateErrorToString(HRESULT p_error)
[AI] Converts a DirectDraw/Direct3D HRESULT enumeration error to a human-readable string.
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.
static HRESULT CALLBACK DisplayModesEnumerateCallback(LPDDSURFACEDESC p_ddsd, LPVOID p_context)
[AI] Static thunk callback for enumerating display modes during driver enumeration.
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.
static void BuildErrorString(const char *,...)
[AI] Utility for formatting and outputting error/debug strings.
[AI] MxDirect3D provides Direct3D (D3D) rendering capabilities layered on top of MxDirectDraw,...
Definition: mxdirect3d.h:24
LPSTR LPSTR LPVOID
Definition: d3dcaps.h:216
struct _DDSURFACEDESC FAR * LPDDSURFACEDESC
Definition: ddraw.h:83
typedef DWORD(FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper
long HRESULT
Definition: ddraw.h:115
typedef BOOL(FAR PASCAL *LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA
[AI] STL compatibility layer header to provide consistent STL (Standard Template Library) types and a...
[AI] Represents a specific display mode supported by the device (width, height, bits per pixel).
Definition: mxdirectxinfo.h:22
int operator==(const Mode &p_mode) const
[AI] Compares two display modes for equality by width, height, and bits per pixel.
Definition: mxdirectxinfo.h:28
int bitsPerPixel
[AI] Color depth (bits per pixel)
Definition: mxdirectxinfo.h:35
int width
[AI] Horizontal resolution in pixels
Definition: mxdirectxinfo.h:33
int height
[AI] Vertical resolution in pixels
Definition: mxdirectxinfo.h:34
[AI] Contains detailed information about a Direct3D device's supported display modes and capabilities...
Definition: mxdirectxinfo.h:16
DeviceModesInfo()
[AI] Constructs an empty DeviceModesInfo with zeroed members.
DDCAPS m_ddcaps
[AI] Capabilities of the DirectDraw device as filled by GetCaps.
Definition: mxdirectxinfo.h:51
Mode * m_modeArray
[AI] Array of supported display modes; dynamically allocated and owned.
Definition: mxdirectxinfo.h:49
void * m_unk0x178
[AI] Unknown purpose, possibly additional device state or context. [AI_SUGGESTED_NAME: extraState]
Definition: mxdirectxinfo.h:52
~DeviceModesInfo()
[AI] Destructor.
int m_count
[AI] Number of display modes in m_modeArray.
Definition: mxdirectxinfo.h:50
GUID * m_guid
[AI] GUID of the video device (heap-allocated and owned by this struct).
Definition: mxdirectxinfo.h:48
[AI] Encapsulates Direct3D device enumeration information and capability structures.
~Direct3DDeviceInfo()
[AI] Destructor; frees owned resources such as GUID and strings.
D3DDEVICEDESC m_HWDesc
[AI] Hardware Direct3D device capability description.
Direct3DDeviceInfo()
[AI] Constructs a zero-initialized Direct3DDeviceInfo instance.
int operator==(Direct3DDeviceInfo) const
[AI] Comparison operator placeholder: returns 0, not implemented.
void Initialize(LPGUID p_guid, LPSTR p_deviceDesc, LPSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc)
[AI] Initializes instance with device GUID, description strings, and capability structures.
int operator<(Direct3DDeviceInfo) const
[AI] Comparison operator placeholder: returns 0, not implemented.
D3DDEVICEDESC m_HELDesc
[AI] Software (HEL) emulation device capability description.
char * m_deviceDesc
[AI] API-provided textual description of device (owned string).
char * m_deviceName
[AI] Unlocalized device name/identifier (owned string).
LPGUID m_guid
[AI] GUID uniquely identifying this 3D device. [AI]
[AI] Utility structure for GUID comparison.
static unsigned char Compare(const GUID4 &p_a, const GUID4 &p_b)
[AI] Compares two GUID4s for complete equality.
[AI] Represents a display mode with specific resolution and color depth.
int operator==(MxDisplayMode) const
[AI] Comparison operator placeholder: returns 0, not implemented.
MxDisplayMode()
[AI] Default constructor.
int operator<(MxDisplayMode) const
[AI] Comparison operator placeholder: returns 0, not implemented.
DWORD m_bitsPerPixel
[AI] Color depth (bits per pixel)
DWORD m_height
[AI] Height in pixels
MxDisplayMode(DWORD p_width, DWORD p_height, DWORD p_bitsPerPixel)
[AI] Initialize the display mode with width, height, and color depth.
DWORD m_width
[AI] Width in pixels
[AI] Holds data about a DirectDraw driver including devices and supported display modes.
void Init(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
[AI] Initializes or resets the driver's GUID and strings.
int operator<(MxDriver) const
[AI] Comparison operator placeholder: returns 0, not implemented.
MxDriver()
[AI] Constructs an empty MxDriver structure.
LPGUID m_guid
[AI] GUID for this DirectDraw driver (heap-allocated and owned).
list< MxDisplayMode > m_displayModes
[AI] List of all display modes reported by the driver.
char * m_driverName
[AI] Driver name/identifier string (owned).
DDCAPS m_ddCaps
[AI] Capabilities structure as reported by the driver.
list< Direct3DDeviceInfo > m_devices
[AI] List of all Direct3D devices provided by this driver.
int operator==(MxDriver) const
[AI] Comparison operator placeholder: returns 0, not implemented.
~MxDriver()
[AI] Destructor; frees GUID and owned strings.
char * m_driverDesc
[AI] Driver description string (owned).
Definition: ddraw.h:269