Isle
Loading...
Searching...
No Matches
mxdirectxinfo.cpp
Go to the documentation of this file.
1#include "mxdirectxinfo.h"
2
3#include <assert.h>
4#include <stdio.h> // for vsprintf
5
13
14// FUNCTION: LEGO1 0x1009b8b0
15// FUNCTION: BETA10 0x1011c05e
17{
18 memset(this, 0, sizeof(*this));
19}
20
21// FUNCTION: LEGO1 0x1009b8d0
22// FUNCTION: BETA10 0x1011c08a
24{
25 if (m_deviceInfo) {
26 delete m_deviceInfo;
27 m_deviceInfo = NULL;
28 }
29}
30
31// FUNCTION: BETA10 0x1011d7f0
32MxDriver::MxDriver(LPGUID p_guid)
33{
34 m_guid = NULL;
37 memset(&m_ddCaps, 0, sizeof(m_ddCaps));
38 // TODO: ret vs ret 4
39}
40
41// FUNCTION: CONFIG 0x00401180
42// FUNCTION: LEGO1 0x1009ba80
43// FUNCTION: BETA10 0x1011d8b6
44MxDriver::MxDriver(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
45{
46 m_guid = NULL;
49 memset(&m_ddCaps, 0, sizeof(m_ddCaps));
50
51 Init(p_guid, p_driverDesc, p_driverName);
52}
53
54// FUNCTION: CONFIG 0x401280
55// FUNCTION: LEGO1 0x1009bb80
56// FUNCTION: BETA10 0x1011d992
58{
59 if (m_guid) {
60 delete m_guid;
61 }
62 if (m_driverDesc) {
63 delete[] m_driverDesc;
64 }
65 if (m_driverName) {
66 delete[] m_driverName;
67 }
68}
69
70// FUNCTION: CONFIG 0x00401330
71// FUNCTION: LEGO1 0x1009bc30
72// FUNCTION: BETA10 0x1011da89
73void MxDriver::Init(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
74{
75 if (m_driverDesc) {
76 delete[] m_driverDesc;
78 }
79
80 if (m_driverName) {
81 delete[] m_driverName;
83 }
84
85 if (p_guid) {
86 m_guid = new GUID;
87 memcpy(m_guid, p_guid, sizeof(*m_guid));
88 }
89
90 if (p_driverDesc) {
91 m_driverDesc = new char[strlen(p_driverDesc) + 1];
92 strcpy(m_driverDesc, p_driverDesc);
93 }
94
95 if (p_driverName) {
96 m_driverName = new char[strlen(p_driverName) + 1];
97 strcpy(m_driverName, p_driverName);
98 }
99}
100
101// FUNCTION: CONFIG 0x401420
102// FUNCTION: LEGO1 0x1009bd20
103// FUNCTION: BETA10 0x1011dbd0
105 LPGUID p_guid,
106 LPSTR p_deviceDesc,
107 LPSTR p_deviceName,
108 LPD3DDEVICEDESC p_HWDesc,
109 LPD3DDEVICEDESC p_HELDesc
110)
111{
112 memset(this, 0, sizeof(*this));
113
114 Initialize(p_guid, p_deviceDesc, p_deviceName, p_HWDesc, p_HELDesc);
115}
116
117// FUNCTION: CONFIG 0x401460
118// FUNCTION: LEGO1 0x1009bd60
119// FUNCTION: BETA10 0x1011dc1a
121{
122 if (m_guid) {
123 delete m_guid;
124 }
125 if (m_deviceDesc) {
126 delete[] m_deviceDesc;
127 }
128 if (m_deviceName) {
129 delete[] m_deviceName;
130 }
131}
132
133// FUNCTION: CONFIG 0x4014a0
134// FUNCTION: LEGO1 0x1009bda0
135// FUNCTION: BETA10 0x1011dca6
137 LPGUID p_guid,
138 LPSTR p_deviceDesc,
139 LPSTR p_deviceName,
140 LPD3DDEVICEDESC p_HWDesc,
141 LPD3DDEVICEDESC p_HELDesc
142)
143{
144 if (m_deviceDesc) {
145 delete[] m_deviceDesc;
147 }
148
149 if (m_deviceName) {
150 delete[] m_deviceName;
152 }
153
154 if (p_guid) {
155 m_guid = new GUID;
156 memcpy(m_guid, p_guid, sizeof(*m_guid));
157 }
158
159 if (p_deviceDesc) {
160 m_deviceDesc = new char[strlen(p_deviceDesc) + 1];
161 strcpy(m_deviceDesc, p_deviceDesc);
162 }
163
164 if (p_deviceName) {
165 m_deviceName = new char[strlen(p_deviceName) + 1];
166 strcpy(m_deviceName, p_deviceName);
167 }
168
169 // DECOMP: Beta shows implicit memcpy for these two members
170 if (p_HWDesc) {
171 m_HWDesc = *p_HWDesc;
172 }
173
174 if (p_HELDesc) {
175 m_HELDesc = *p_HELDesc;
176 }
177}
178
179// FUNCTION: CONFIG 0x004015c0
180// FUNCTION: LEGO1 0x1009bec0
181// FUNCTION: BETA10 0x1011ddf8
183{
185}
186
187// FUNCTION: CONFIG 0x401710
188// FUNCTION: LEGO1 0x1009c010
189// FUNCTION: BETA10 0x1011de74
191{
192}
193
194// FUNCTION: CONFIG 0x00401770
195// FUNCTION: LEGO1 0x1009c070
196// FUNCTION: BETA10 0x1011dedf
197BOOL MxDeviceEnumerate::EnumDirectDrawCallback(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
198{
199 MxDriver driver(p_guid, p_driverDesc, p_driverName);
200 m_list.push_back(driver);
201
202 // Must be zeroed because held resources are copied by pointer only
203 // and should not be freed at the end of this function
204 driver.m_guid = NULL;
205 driver.m_driverDesc = NULL;
206 driver.m_driverName = NULL;
207 memset(&driver.m_ddCaps, 0, sizeof(driver.m_ddCaps));
208
209 LPDIRECT3D2 lpDirect3d2 = NULL;
210 LPDIRECTDRAW lpDD = NULL;
211 MxDriver& newDevice = m_list.back();
212 HRESULT result = DirectDrawCreate(newDevice.m_guid, &lpDD, NULL);
213
214 if (result != DD_OK) {
215 BuildErrorString("DirectDraw Create failed: %s\n", EnumerateErrorToString(result));
216 }
217 else {
218 lpDD->EnumDisplayModes(0, NULL, this, DisplayModesEnumerateCallback);
219 newDevice.m_ddCaps.dwSize = sizeof(newDevice.m_ddCaps);
220 result = lpDD->GetCaps(&newDevice.m_ddCaps, NULL);
221
222 if (result != DD_OK) {
223 BuildErrorString("GetCaps failed: %s\n", EnumerateErrorToString(result));
224 }
225 else {
226 result = lpDD->QueryInterface(IID_IDirect3D2, (LPVOID*) &lpDirect3d2);
227
228 if (result != DD_OK) {
229 BuildErrorString("D3D creation failed: %s\n", EnumerateErrorToString(result));
230 }
231 else {
232 result = lpDirect3d2->EnumDevices(DevicesEnumerateCallback, this);
233
234 if (result != DD_OK) {
235 BuildErrorString("D3D enum devices failed: %s\n", EnumerateErrorToString(result));
236 }
237 else {
238 if (!newDevice.m_devices.size()) {
239 m_list.pop_back();
240 }
241 }
242 }
243 }
244 }
245
246 if (lpDirect3d2) {
247 lpDirect3d2->Release();
248 }
249
250 if (lpDD) {
251 lpDD->Release();
252 }
253
254 return DDENUMRET_OK;
255}
256
257// FUNCTION: CONFIG 0x00401bc0
258// FUNCTION: LEGO1 0x1009c4c0
259// FUNCTION: BETA10 0x1011e193
260void MxDeviceEnumerate::BuildErrorString(const char* p_format, ...)
261{
262 va_list args;
263 char buf[512];
264
265 va_start(args, p_format);
266 vsprintf(buf, p_format, args);
267 va_end(args);
268
269 OutputDebugString(buf);
270}
271
272// FUNCTION: CONFIG 0x00401bf0
273// FUNCTION: LEGO1 0x1009c4f0
274// FUNCTION: BETA10 0x1011e1dd
276{
277 if (p_context == NULL) {
278 assert(0);
279 }
280
281 return ((MxDeviceEnumerate*) p_context)->EnumDisplayModesCallback(p_ddsd);
282}
283
284// FUNCTION: CONFIG 0x00401c10
285// FUNCTION: LEGO1 0x1009c510
286// FUNCTION: BETA10 0x1011e226
288 LPGUID p_guid,
289 LPSTR p_deviceDesc,
290 LPSTR p_deviceName,
291 LPD3DDEVICEDESC p_HWDesc,
292 LPD3DDEVICEDESC p_HELDesc,
293 LPVOID p_context
294)
295{
296 if (p_context == NULL) {
297 assert(0);
298 }
299
300 return ((MxDeviceEnumerate*) p_context)
301 ->EnumDevicesCallback(p_guid, p_deviceDesc, p_deviceName, p_HWDesc, p_HELDesc);
302}
303
304// FUNCTION: CONFIG 0x00401c40
305// FUNCTION: LEGO1 0x1009c540
306// FUNCTION: BETA10 0x1011e27f
308{
309 assert(m_list.size() > 0);
310 assert(p_ddsd);
311
312 // TODO: compat_mode?
313 MxDisplayMode displayMode(p_ddsd->dwWidth, p_ddsd->dwHeight, p_ddsd->ddpfPixelFormat.dwRGBBitCount);
314 m_list.back().m_displayModes.push_back(displayMode);
315 return DDENUMRET_OK;
316}
317
318// FUNCTION: CONFIG 0x00401cd0
319// FUNCTION: LEGO1 0x1009c5d0
320// FUNCTION: BETA10 0x1011e32f
322 LPGUID p_guid,
323 LPSTR p_deviceDesc,
324 LPSTR p_deviceName,
325 LPD3DDEVICEDESC p_HWDesc,
326 LPD3DDEVICEDESC p_HELDesc
327)
328{
329 Direct3DDeviceInfo device(p_guid, p_deviceDesc, p_deviceName, p_HWDesc, p_HELDesc);
330 m_list.back().m_devices.push_back(device);
331 memset(&device, 0, sizeof(device));
332 return DDENUMRET_OK;
333}
334
335// FUNCTION: CONFIG 0x00401dc0
336// FUNCTION: LEGO1 0x1009c6c0
337// FUNCTION: BETA10 0x1011e3fa
339{
340 if (IsInitialized()) {
341 return -1;
342 }
343
344 HRESULT ret = DirectDrawEnumerate(DirectDrawEnumerateCallback, this);
345 if (ret != DD_OK) {
346 BuildErrorString("DirectDrawEnumerate returned error %s\n", EnumerateErrorToString(ret));
347 return -1;
348 }
349
351 return 0;
352}
353
354// FUNCTION: CONFIG 0x00401e10
355// FUNCTION: LEGO1 0x1009c710
356// FUNCTION: BETA10 0x1011e476
357BOOL CALLBACK
358MxDeviceEnumerate::DirectDrawEnumerateCallback(LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName, LPVOID p_context)
359{
360 if (p_context == NULL) {
361 assert(0);
362 }
363
364 return ((MxDeviceEnumerate*) p_context)->EnumDirectDrawCallback(p_guid, p_driverDesc, p_driverName);
365}
366
367// FUNCTION: CONFIG 0x00401e30
368// FUNCTION: LEGO1 0x1009c730
369// FUNCTION: BETA10 0x1011e4c7
371{
372 switch (p_error) {
373 case DD_OK:
374 return "No error.";
375 case DDERR_GENERIC:
376 return "Generic failure.";
378 return "Action not supported.";
380 return "One or more of the parameters passed to the function are incorrect.";
382 return "DirectDraw does not have enough memory to perform the operation.";
384 return "This surface can not be attached to the requested surface.";
386 return "This object is already initialized.";
388 return "Support is currently not available.";
390 return "This surface can not be detached from the requested surface.";
392 return "Height of rectangle provided is not a multiple of reqd alignment.";
393 case DDERR_EXCEPTION:
394 return "An exception was encountered while performing the requested operation.";
396 return "One or more of the caps bits passed to the callback are incorrect.";
398 return "Unable to match primary surface creation request with existing primary surface.";
400 return "DirectDraw does not support the requested mode.";
402 return "DirectDraw does not support the provided cliplist.";
404 return "The pixel format was invalid as specified.";
406 return "DirectDraw received a pointer that was an invalid DIRECTDRAW object.";
408 return "Operation could not be carried out because one or more surfaces are locked.";
410 return "Rectangle provided was invalid.";
411 case DDERR_NOALPHAHW:
412 return "Operation could not be carried out because there is no alpha accleration hardware present or "
413 "available.";
414 case DDERR_NO3D:
415 return "There is no 3D present.";
417 return "Operation could not be carried out because there is no color conversion hardware present or available.";
418 case DDERR_NOCLIPLIST:
419 return "No cliplist available.";
420 case DDERR_NOCOLORKEY:
421 return "Surface doesn't currently have a color key";
423 return "Create function called without DirectDraw object method SetCooperativeLevel being called.";
425 return "Operation requires the application to have exclusive mode but the application does not have exclusive "
426 "mode.";
428 return "Operation could not be carried out because there is no hardware support of the destination color key.";
429 case DDERR_NOGDI:
430 return "There is no GDI present.";
431 case DDERR_NOFLIPHW:
432 return "Flipping visible surfaces is not supported.";
433 case DDERR_NOTFOUND:
434 return "Requested item was not found.";
435 case DDERR_NOMIRRORHW:
436 return "Operation could not be carried out because there is no hardware present or available.";
438 return "Operation could not be carried out because there is no appropriate raster op hardware present or "
439 "available.";
441 return "Operation could not be carried out because there is no overlay hardware present or available.";
443 return "Operation could not be carried out because there is no hardware support for stretching.";
445 return "Operation could not be carried out because there is no rotation hardware present or available.";
447 return "Operation could not be carried out because there is no texture mapping hardware present or available.";
449 return "DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color "
450 "palette.";
452 return "DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color "
453 "index palette.";
455 return "DirectDrawSurface is not in 8 bit color mode and the requested operation requires 8 bit color.";
457 return "Operation could not be carried out because there is no hardware support for zbuffer blitting.";
458 case DDERR_NOVSYNCHW:
459 return "Operation could not be carried out because there is no hardware support for vertical blank "
460 "synchronized operations.";
461 case DDERR_OUTOFCAPS:
462 return "The hardware needed for the requested operation has already been allocated.";
464 return "Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support "
465 "z layering of overlays.";
467 return "No src color key specified for this operation.";
469 return "DirectDraw does not have enough memory to perform the operation.";
471 return "The hardware does not support clipped overlays.";
473 return "Can only have ony color key active at one time for overlays.";
475 return "Access to this palette is being refused because the palette is already locked by another thread.";
477 return "This surface is already a dependency of the surface it is being made a dependency of.";
479 return "This surface is already attached to the surface it is being attached to.";
481 return "Access to surface refused because the surface is obscured.";
483 return "Access to this surface is being refused because the surface is already locked by another thread.";
485 return "The requested surface is not attached.";
487 return "Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface "
488 "object representing this surface should have Restore called on it.";
489 case DDERR_TOOBIGSIZE:
490 return "Size requested by DirectDraw is too large, but the individual height and width are OK.";
492 return "Height requested by DirectDraw is too large.";
494 return "FOURCC format requested is unsupported by DirectDraw.";
496 return "Width requested by DirectDraw is too large.";
498 return "Vertical blank is in progress.";
500 return "Bitmask in the pixel format requested is unsupported by DirectDraw.";
501 case DDERR_XALIGN:
502 return "Rectangle provided was not horizontally aligned on required boundary.";
504 return "Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is "
505 "incomplete.";
507 return "The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.";
509 return "A DirectDraw object representing this driver has already been created for this process.";
511 return "A hardware-only DirectDraw object creation was attempted but the driver did not support any hardware.";
513 return "This process already has created a primary surface.";
515 return "Software emulation not available.";
517 return "Region passed to Clipper::GetClipList is too small.";
519 return "An attempt was made to set a cliplist for a clipper object that is already monitoring an hwnd.";
521 return "No clipper object attached to surface object.";
522 case DDERR_NOHWND:
523 return "Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel HWND.";
525 return "HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring "
526 "state.";
528 return "The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or "
529 "palettes created.";
531 return "No palette object attached to this surface.";
533 return "No hardware support for 16 or 256 color palettes.";
535 return "Return if a clipper object is attached to the source surface passed into a BltFast call.";
536 case DDERR_NOBLTHW:
537 return "No blitter hardware present.";
538 case DDERR_NODDROPSHW:
539 return "No DirectDraw ROP hardware.";
541 return "Returned when GetOverlayPosition is called on a hidden overlay.";
543 return "Returned when GetOverlayPosition is called on an overlay that UpdateOverlay has never been called on "
544 "to establish a destination.";
546 return "Returned when the position of the overlay on the destination is no longer legal for that destination.";
548 return "Returned when an overlay member is called for a non-overlay surface.";
550 return "An attempt was made to set the cooperative level when it was already set to exclusive.";
552 return "An attempt has been made to flip a surface that is not flippable.";
554 return "Can't duplicate primary & 3D surfaces, or surfaces that are implicitly created.";
555 case DDERR_NOTLOCKED:
556 return "Surface was not locked. An attempt to unlock a surface that was not locked at all, or by this "
557 "process, has been attempted.";
559 return "Windows can not create any more DCs.";
560 case DDERR_NODC:
561 return "No DC was ever created for this surface.";
562 case DDERR_WRONGMODE:
563 return "This surface can not be restored because it was created in a different mode.";
565 return "This surface can not be restored because it is an implicitly created surface.";
567 return "The surface being used is not a palette-based surface.";
568 default:
569 return "Unrecognized error value.";
570 }
571}
572
573// FUNCTION: LEGO1 0x1009efb0
574// FUNCTION: BETA10 0x10122ee2
576{
577 memset(this, 0, sizeof(*this));
578}
579
580// FUNCTION: LEGO1 0x1009efd0
581// FUNCTION: BETA10 0x10122f0e
583{
584 if (m_guid != NULL) {
585 delete m_guid;
586 }
587
588 if (m_modeArray != NULL) {
589 delete[] m_modeArray;
590 }
591}
[AI] Holds assignment and description details for a Direct3D rendering device in use.
Definition: mxdirectxinfo.h:65
~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 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.
struct IDirect3D2 * LPDIRECT3D2
Definition: d3d.h:86
LPSTR LPSTR LPVOID
Definition: d3dcaps.h:216
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE
Definition: ddraw.h:3440
#define DDERR_NOT8BITCOLOR
Definition: ddraw.h:3390
#define DDERR_NOSTRETCHHW
Definition: ddraw.h:3372
#define DDERR_NOTAOVERLAYSURFACE
Definition: ddraw.h:3652
#define DDERR_INVALIDRECT
Definition: ddraw.h:3271
#define DDERR_NOT4BITCOLORINDEX
Definition: ddraw.h:3384
#define DDERR_HEIGHTALIGN
Definition: ddraw.h:3229
#define DDENUMRET_OK
Definition: ddraw.h:3186
#define DDERR_NOOVERLAYDEST
Definition: ddraw.h:3641
struct _DDSURFACEDESC FAR * LPDDSURFACEDESC
Definition: ddraw.h:83
#define DDERR_INVALIDPIXELFORMAT
Definition: ddraw.h:3266
#define DDERR_VERTICALBLANKINPROGRESS
Definition: ddraw.h:3530
#define DDERR_NOTFLIPPABLE
Definition: ddraw.h:3663
#define DDERR_NOVSYNCHW
Definition: ddraw.h:3402
#define DDERR_NODC
Definition: ddraw.h:3685
#define DDERR_OVERLAYCANTCLIP
Definition: ddraw.h:3435
#define DDERR_WRONGMODE
Definition: ddraw.h:3691
#define DDERR_OUTOFCAPS
Definition: ddraw.h:3420
#define DDERR_NOFLIPHW
Definition: ddraw.h:3332
#define DDERR_UNSUPPORTEDMASK
Definition: ddraw.h:3525
#define DDERR_INVALIDCAPS
Definition: ddraw.h:3240
#define DDERR_INVALIDOBJECT
Definition: ddraw.h:3255
#define DDERR_INVALIDMODE
Definition: ddraw.h:3250
#define DDERR_CANNOTATTACHSURFACE
Definition: ddraw.h:3204
#define DDERR_UNSUPPORTEDFORMAT
Definition: ddraw.h:3520
#define DDERR_NOZOVERLAYHW
Definition: ddraw.h:3414
#define DDERR_NOTFOUND
Definition: ddraw.h:3348
#define DDERR_SURFACELOST
Definition: ddraw.h:3489
#define DDERR_NOOVERLAYHW
Definition: ddraw.h:3354
#define DDERR_NOT4BITCOLOR
Definition: ddraw.h:3378
#define DDERR_SURFACEALREADYDEPENDENT
Definition: ddraw.h:3462
#define DDERR_SURFACEISOBSCURED
Definition: ddraw.h:3482
#define DDERR_NOHWND
Definition: ddraw.h:3592
#define DDERR_INCOMPATIBLEPRIMARY
Definition: ddraw.h:3235
#define DDERR_EXCEPTION
Definition: ddraw.h:3219
#define DDERR_EXCLUSIVEMODEALREADYSET
Definition: ddraw.h:3658
#define DDERR_NOCLIPLIST
Definition: ddraw.h:3293
#define DDERR_PALETTEBUSY
Definition: ddraw.h:3446
#define DDERR_NOCOLORCONVHW
Definition: ddraw.h:3299
#define DDERR_WASSTILLDRAWING
Definition: ddraw.h:3536
#define DDERR_HWNDSUBCLASSED
Definition: ddraw.h:3598
#define DDERR_NOEXCLUSIVEMODE
Definition: ddraw.h:3327
#define DDERR_OVERLAYNOTVISIBLE
Definition: ddraw.h:3635
#define DDERR_NODDROPSHW
Definition: ddraw.h:3630
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:3425
#define DDERR_TOOBIGSIZE
Definition: ddraw.h:3505
#define DDERR_NOZBUFFERHW
Definition: ddraw.h:3408
#define DDERR_CANTCREATEDC
Definition: ddraw.h:3680
#define DDERR_HWNDALREADYSET
Definition: ddraw.h:3604
#define DDERR_NOPALETTEATTACHED
Definition: ddraw.h:3609
#define DDERR_NO3D
Definition: ddraw.h:3281
#define DDERR_XALIGN
Definition: ddraw.h:3542
#define DDERR_NOCOLORKEY
Definition: ddraw.h:3310
#define DDERR_CURRENTLYNOTAVAIL
Definition: ddraw.h:3214
#define DDERR_OUTOFVIDEOMEMORY
Definition: ddraw.h:3430
#define DDERR_NOCOOPERATIVELEVELSET
Definition: ddraw.h:3305
#define DD_OK
Definition: ddraw.h:3166
#define DDERR_SURFACENOTATTACHED
Definition: ddraw.h:3494
#define DDERR_DIRECTDRAWALREADYCREATED
Definition: ddraw.h:3554
#define DDERR_NOCOLORKEYHW
Definition: ddraw.h:3316
#define DDERR_COLORKEYNOTSET
Definition: ddraw.h:3451
long HRESULT
Definition: ddraw.h:115
#define DDERR_UNSUPPORTED
Definition: ddraw.h:3515
#define DDERR_REGIONTOOSMALL
Definition: ddraw.h:3575
#define DDERR_TOOBIGWIDTH
Definition: ddraw.h:3510
#define DDERR_NOGDI
Definition: ddraw.h:3337
#define DDERR_NOPALETTEHW
Definition: ddraw.h:3614
#define DDERR_INVALIDDIRECTDRAWGUID
Definition: ddraw.h:3548
#define DDERR_CANTDUPLICATE
Definition: ddraw.h:3669
#define DDERR_GENERIC
Definition: ddraw.h:3224
#define DDERR_INVALIDCLIPLIST
Definition: ddraw.h:3245
#define DDERR_NOCLIPPERATTACHED
Definition: ddraw.h:3586
#define DDERR_IMPLICITLYCREATED
Definition: ddraw.h:3697
#define DDERR_NOTPALETTIZED
Definition: ddraw.h:3702
struct IDirectDraw FAR * LPDIRECTDRAW
Definition: ddraw.h:72
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:3261
#define DDERR_NOALPHAHW
Definition: ddraw.h:3287
#define DDERR_CLIPPERISUSINGHWND
Definition: ddraw.h:3581
#define DDERR_NOROTATIONHW
Definition: ddraw.h:3366
#define DDERR_NORASTEROPHW
Definition: ddraw.h:3360
#define DDERR_LOCKEDSURFACES
Definition: ddraw.h:3276
#define DDERR_SURFACEALREADYATTACHED
Definition: ddraw.h:3456
#define DDERR_NOEMULATION
Definition: ddraw.h:3570
#define DDERR_ALREADYINITIALIZED
Definition: ddraw.h:3199
#define DDERR_NOTLOCKED
Definition: ddraw.h:3675
#define DDERR_NOTEXTUREHW
Definition: ddraw.h:3396
#define DDERR_CANNOTDETACHSURFACE
Definition: ddraw.h:3209
#define DDERR_SURFACEBUSY
Definition: ddraw.h:3468
#define DDERR_NOBLTHW
Definition: ddraw.h:3625
#define DDERR_NODIRECTDRAWHW
Definition: ddraw.h:3560
#define DDERR_INVALIDPOSITION
Definition: ddraw.h:3647
#define DDERR_TOOBIGHEIGHT
Definition: ddraw.h:3499
#define DDERR_PRIMARYSURFACEALREADYEXISTS
Definition: ddraw.h:3565
#define DDERR_BLTFASTCANTCLIP
Definition: ddraw.h:3620
#define DDERR_NOMIRRORHW
Definition: ddraw.h:3343
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
typedef BOOL(FAR PASCAL *LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
[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.
Mode * m_modeArray
[AI] Array of supported display modes; dynamically allocated and owned.
Definition: mxdirectxinfo.h:49
~DeviceModesInfo()
[AI] Destructor.
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.
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.
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] Represents a display mode with specific resolution and color depth.
[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.
MxDriver()
[AI] Constructs an empty MxDriver structure.
LPGUID m_guid
[AI] GUID for this DirectDraw driver (heap-allocated and owned).
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.
~MxDriver()
[AI] Destructor; frees GUID and owned strings.
char * m_driverDesc
[AI] Driver description string (owned).
DWORD dwSize
Definition: ddraw.h:270