For games that use d3dim.dll, how can I check which exact version of Direct3D is used?

Comparing the ddraw.h files from SDK 2 and 3, the only differences are:

Screenshot 2023-09-12 151303.png

Screenshot 2023-09-12 151320.png

The first ones are comments. I don't know what display mode "e" is. It seems DirectDraw 3 isn't really a thing.

Going by the corresponding DX release numbers, we apparently have DirectDraw 1, 2, 6 and 7.
 
Last edited:
Some games have issues on Windows 10 that cannot be remedied with dgvoodoo2, like failing to launch or crashing.
Tbf I've yet to run into a game which I weren't able to launch in some way or another on Win10/11.
Sometimes that requires doing things which will prevent or make impossible original API tracing though.
Generally the go to solution as weirdly as it is is to change the Windows compatibility option - switching to Win95 to WinXP and vice versa.

Going by the corresponding DX release numbers, we apparently have DirectDraw 1, 2, 6 and 7.
There were changes to DDraw in DX5 so there's that at least.
 
Yea, that's correct. I was going based on the table from page 1, since it doesn't have any DDraw related interfaces listed for 5.

I checked ddraw.h from SDK 5, and turns out DirectDrawSurface3 was introduced with this release, not DX3. There's also a DirectDrawColorControl.
 
I guess it's the second option. I'm running Windows 10 on the host PC. I then installed VMware Workstation, and then created a VM and installed XP.
I'm asking because your descrption of Direct3D 8 crashes would be consistent with a "software" type2 hypervisor, when the guest OS is relying on the host OS kernel and kernel-mode video driver. However this is used for lightweight, "container" type virtualization, when Windows OS versions are the same between host and VM, and VMWare Workstation is supposed to be type1 or fully isolated "hardware" hypervisor. Maybe I just don't understand how Direct3D is handled in the guest OS...

I suppose you run it on a modern PC with a recent video card - what kind of video driver is installed in the Windows XP VM?


if I edit the game's page on pcgamingwiki, should I list it as using Direct3D?
Well, technically this game does use Direct3D 7 for something that's not very obvious.
From the point of someone who builds a retro PC or installs a legacy OS in a VM, the important part is the executable statically links to the DLL and fails to load if it's missing.
But they just need to install the full DirectX 7 redistributable package to fix this.

So I would list it as DirectDraw and make a note about Direct3D 7.0 depedency.


DirectX 1.0 SDK can be found on archive.org
I recall it was "Windows Game SDK", and there were literally like two games that actually used it - even the rudimental WinG had far more titles, including Windows ports of Doom, Civilization II, and SimCity 2000.

IDirectDraw2 and IDirectDrawSurface2 were added in DirectX 2.0 SDK, but they only have one or two new methods.

What these differences do exactly?
Since you asked nicely... first is an unused parameter that was discarded anyway, and the other is also nothing much to talk about - a completely broken material system, i.e. object color and/or texture, if you called ID3DMaterial::SetMaterial after IDirect3D::CreateMaterial :)

I guess back then game developers wouldn't act surprised if they had to fix source code errors in SDK header files...

Going by the corresponding DX release numbers, we apparently have DirectDraw 1, 2, 6 and 7.
Except no-one used these version numbers, since additions to the interfaces were minimal. I would just go with calling them all DirectDraw, and list the version of DirectX runtime the game ships with.

BTW, DDRAW.h in DirectX 5.0 SDK did have version #defines and blocks of conditional compile directives, but these blocks were removed in DirectX 6 SDK and replaced with code comments like "Added in version ...".

I don't know what display mode "e" is.
That's an unnamed optional parameter that does something internally (or maybe it doesn't).


I was going based on the table from page 1, since it doesn't have any DDraw related interfaces listed for 5.
It's not a comprehensive list, just a few hints to look for when you need to detect Direct3D version.

I checked ddraw.h from SDK 5, and turns out DirectDrawSurface3 was introduced with this release,
Yep, it's corrected.
 
Last edited:
I'm asking because your descrption of Direct3D 8 crashes would be consistent with a "software" type2 hypervisor, when the guest OS is relying on the host OS kernel and kernel-mode video driver. However this is used for lightweight, "container" type virtualization, when Windows OS versions are the same between host and VM, and VMWare Workstation is supposed to be type1 or fully isolated "hardware" hypervisor. Maybe I just don't understand how Direct3D is handled in the guest OS...

I suppose you run it on a modern PC with a recent video card - what kind of video driver is installed in the Windows XP VM?

Not crashes, I wrote d3d8 is mostly fine. It's just not handled as well as d3d9, and has lower performance (not too bad though), and visual glitches in some situations.
The main issue is older d3d games. Visually they seem to be ok (although I haven't tested many), but the frame rate is in low single digits.

IINM VMware Workstation is type 2. The host is windows 10 64-bit with a GTX 1060 card. For the guest XP, the only video driver available is the one supplied by VMware through their "VMware Tools" guest additions.

Well, technically this game does use Direct3D 7 for something that's not very obvious, even though it's primatily rendering sprites with DirectDraw 7.
From the point of someone who builds a retro PC or installs a legacy OS in a VM, the important part is the executable statically links to the DLL and fails to load if it's missing.
But they just need to install the full DirectX 7 redistributable package to fix this.

So I would list it as DirectDraw and make a note about Direct3D 7.0 depedency.

It shouldn't be an issue with Windows ME and up, since they include d3d7 files. People usually use that wiki for running old games on newer OS, but your suggestion makes sense.
It doesn't seem to be really using d3d7 features, so listing it as ddraw with a note about d3d should suffice.

Since you asked nicely... first is an unused parameter that was discarded anyway, and the other is also nothing much to talk about - a completely broken material system, i.e. object color and/or texture, if you called ID3DMaterial::SetMaterial after IDirect3D::CreateMaterial :)

I guess back then game developers wouldn't act surprised if they had to fix source code errors in SDK header files...

So basically it was a bug in the source. 😆
Might be one of the reasons DX3 was released just a short while after DX2.

It's not a comprehensive list, just a few hints to look for when you need to detect Direct3D version.

Yep, it's corrected.

It's a great reference. Thanks.
IINM there is one too many D in these two though:

IDirect3DD3::CreateVertexBuffer
IDirect3DD3::EnumZBufferFormats
 
Last edited:
IINM VMware Workstation is type 2. The host is windows 10 64-bit with a GTX 1060 card. For the guest XP, the only video driver available is the one supplied by VMware through their "VMware Tools" guest additions.
Ah. This starts to make sense now. Not sure why I assumed it to be type 1, when type 2 is mentioned everywhere including Wikipedia article on WMware Workstation. :(

Not crashes, I wrote d3d8 is mostly fine. It's just not handled as well as d3d9, and has lower performance (not too bad though), and visual glitches in some situations.
The main issue is older d3d games. Visually they seem to be ok (although I haven't tested many), but the frame rate is in low single digits.

Not surprising when Direct3D calls get redirected to the same fixed-function emulation in the Windows 10 host OS. dgVoodoo2 emulation seems to work better for Direct3D 5/6/7 era games.


So basically it was a bug in the source. 😆
Might be one of the reasons DX3 was released just a short while after DX2.
That's the most likely reason, considering they had to actually ship an updated CD media to distribute this bug fix.

there is one too many D in these two though
Should be OK now!
 
I've downloaded the Zoo Tycoon demo from the Internet Archive so I could check the DLL imports and capture my own API trace, and I have to say that Zoo Tycoon definitely uses GDI32 and WINMM to render the game content, not DirectX, because ZOODEMO.exe doesn't import or delay-load any of dsound.dll, ddraw.dll, d3dimm.dll or d3dimm700.dll libraries (which would be the preferred method in DirectX SDK), and dgVoodoo2 API trace does not show any DirectDraw calls during the gameplay.


What's actually happening, the game invokes DirectShow to play back the included video clips, and DirectShow invokes DirectDraw and Direct3D to build a video filter graph by pinging for various rendering interfaces and surface formats, to find a suitable combination for the DirectShow video renderer filter.

DirectShow's quartz.dll is not listed in export symbols since there is no need to statically link this DLL and it's loaded on-demand with LoadLibrary().


Note these QueryInterface calls with a reference to an "unknown" IID resulting in an error:
Code:
DirectDraw::QueryInterface (this = 0C279CB0, riid = {aca12120-3356-11d1-8fcf-00c04fc29b4e} (?), ppvObject = 007D9A50)
Direct3D::QueryInterface (this = 0C456530, riid = ?, ppvObject = 007D9A50)
[dgVoodoo] ERROR: DirectDraw (0C279CB0)::QueryInterface: Creating aggregated D3D object has failed on DirectDraw.
[dgVoodoo] ERROR: DirectDraw (0C279CB0)::QueryInterface: Unknown interface (riid = {{aca12120-3356-11d1-8fcf-00c04fc29b4e}}) is being queried.

In some non-obvious places like the D language runtime, this GUID is defined as IID_IDDVideoAcceleratorContainer. However such interface and IID/GUID were never defined in public Microsoft SDKs - though there is a similarily named IID_IDDVideoPortContainer definition in DVP.h (DirectDrawVideoPort) from the DirectX 5.0 SDK, which seemed to implement a user-mode hook to Video Port Extensions in XDDM (i.e. Windows 2000 display driver model).

So it seems like IDDVideoAcceleratorContainer was some internal DirectDraw interface retained for legacy DirectShow compatibility only (likely inherited from a proprietary unreleased iDirectDraw3 implementation for the ActiveMovie control in IE 3.0).


FYI this IID often shows up in error reports for various Direct3D injection and/or emulation tools, like dgVoodoo2 itself, DXWnd, Wine emulator, Steam client's Game Overlay Renderer, etc.



 
Last edited:
Hey, I didn't even think about also checking the dependencies, since I thought the traces would suffice. Thanks.

I guess the process going forward has to be to check dependencies first, and then traces.
 
Encountered another odd 2D game; Age of Wonders II. There is a Direct3D option in its configuration tool. I see Direct3D related traces in the log, like IDirect3DVertexBuffer7.

The log file is too large to attach, even in zip format.

EDIT: https://file.io/VD5DW7GqD8hN
 
Last edited:
File.io says "The transfer you requested has been deleted".

I've downloaded AoW II media from the Internet Archive and it installed fine, but I couldn't get the game to start. Will give it another try a bit later.
 
Last edited:
The site doesn't open for me unfortunately.

Did you try to look for the usual Direct3D methods? I didn't list any Direct3D 7-specific methods in my reference post because the methods are named essentially the same as they were in Direct3D 5 and 6.

The inquiry should go like this - if the game calls QueryInterface for IDirect3D7 to enumerate devices, then proceeds to create IDirect3DDevice7 using hardware rendering device IDirect3DHALDevice, configures texture blending stages with SetTextureStageState, and renders some triangles with DrawPrimitive/DrawIndexedPrimitive or DrawPrimitiveVB/DrawIndexedPrimitiveVB into a RenderTarget surface, setting the textures with SetMaterial/SetTexture and the blending mode with SetRenderState, then it does render the game content using Direct3D 7.

2D games like AOW II will probably use Direct3D for hardware-accelerated sprite rendering with alpha blending, because DirectDraw never actually implemented hardware blending. The reason is, DirectDraw supports arbitrary texture (sprite) sizes and aspect ratios, but early Direct3D GPUs strictly required power-of-2 texture sizes and 1:1 ratio (and even when GPUs do support non-power-of-2 textures, it's quite slow).
 
Last edited:
I thought about going through the d3d.h files from old SDKs. The following seem to be all the D3D interface differences in the Direct3D and Direct3DDevice sections.
(x) denotes a removed interface from previous versions.

Direct3D 2 (3 has the same interfaces)
Direct3D 5​
Direct3D 6​
Direct3D 7​
Jun 1996Aug 1997Aug 1998Sep 1999
IDirect3D
IDirect3DDevice
IDirect3DTexture
IDirect3DMaterial
IDirect3DViewport

IDirect3D_Initialize

IDirect3DDevice_Initialize
IDirect3DDevice_CreateExecuteBuffer
IDirect3DDevice_Execute
IDirect3DDevice_Pick
IDirect3DDevice_GetPickRecords
IDirect3DDevice_CreateMatrix
IDirect3DDevice_SetMatrix
IDirect3DDevice_GetMatrix
IDirect3DDevice_DeleteMatrix
IDirect3D2
IDirect3DRampDevice
IDirect3DRGBDevice
IDirect3DHALDevice
IDirect3DMMXDevice
IDirect3DDevice2
IDirect3DTexture2
IDirect3DMaterial2
IDirect3DViewport2

(x) _Initialize
IDirect3D2_CreateDevice

IDirect3DDevice2_SetCurrentViewport
IDirect3DDevice2_GetCurrentViewport
IDirect3DDevice2_SetRenderTarget
IDirect3DDevice2_GetRenderTarget
IDirect3DDevice2_Begin
IDirect3DDevice2_BeginIndexed
IDirect3DDevice2_Vertex
IDirect3DDevice2_Index
IDirect3DDevice2_End
IDirect3DDevice2_GetRenderState
IDirect3DDevice2_SetRenderState
IDirect3DDevice2_GetLightState
IDirect3DDevice2_SetLightState
IDirect3DDevice2_SetTransform
IDirect3DDevice2_GetTransform
IDirect3DDevice2_MultiplyTransform
IDirect3DDevice2_DrawPrimitive
IDirect3DDevice2_DrawIndexedPrimitive
IDirect3DDevice2_SetClipStatus
IDirect3DDevice2_GetClipStatus
IDirect3D3
IDirect3DRefDevice
IDirect3DNullDevice
IDirect3DDevice3
IDirect3DMaterial3
IDirect3DViewport3
IDirect3DVertexBuffer

(x) _SwapTextureHandles
IDirect3DDevice3_DrawPrimitiveStrided
IDirect3DDevice3_DrawIndexedPrimitiveStrided
IDirect3DDevice3_DrawPrimitiveVB
IDirect3DDevice3_DrawIndexedPrimitiveVB
IDirect3DDevice3_ComputeSphereVisibility
IDirect3DDevice3_GetTexture
IDirect3DDevice3_SetTexture
IDirect3DDevice3_GetTextureStageState
IDirect3DDevice3_SetTextureStageState
IDirect3DDevice3_ValidateDevice
IDirect3D7
IDirect3DTnLHalDevice
IDirect3DDevice7
IDirect3DVertexBuffer7

(x) _CreateLight
(x) _CreateMaterial
(x) _CreateViewport
(x) _FindDevice

IDirect3DDevice7_SetViewport
IDirect3DDevice7_GetViewport
IDirect3DDevice7_SetMaterial
IDirect3DDevice7_GetMaterial
IDirect3DDevice7_SetLight
IDirect3DDevice7_GetLight
IDirect3DDevice7_BeginStateBlock
IDirect3DDevice7_EndStateBlock
IDirect3DDevice7_PreLoad
IDirect3DDevice7_ApplyStateBlock
IDirect3DDevice7_CaptureStateBlock
IDirect3DDevice7_DeleteStateBlock
IDirect3DDevice7_CreateStateBlock
IDirect3DDevice7_Load
IDirect3DDevice7_LightEnable
IDirect3DDevice7_GetLightEnable
IDirect3DDevice7_SetClipPlane
IDirect3DDevice7_GetClipPlane
IDirect3DDevice7_GetInfo
(x) _GetStats
(x) _AddViewport
(x) _DeleteViewport
(x) _NextViewport
(x) _SetCurrentViewport
(x) _GetCurrentViewport
(x) _BeginIndexed
(x) _Vertex
(x) _Index
(x) _End
(x) _GetRenderState
(x) _SetRenderState
(x) _GetLightState
(x) _SetLightState
 
Last edited:
Some early D3D8 games have Direct3D8Device::CreateVertexShader in the log, but I don't see vs.1 anywhere (or ps.1).

If it doesn't actually use shaders, what's that interface used for?
 
It should be this method... does the log contain references to Direct3DShaderValidator method?
 
Last edited:
I went back and looked at the logs from a few games but now can't find CreateVertexShader. I have no idea what's going on. Perhaps I made a mistake, or losing my mind. Quite certain I saw it.

I do see the SetVertexShader interface, although there are no shaders, and no Validate.

I also uploaded Age of Wonders 2's log to google drive. This one should work: https://drive.google.com/file/d/1K_ryB-RBMDZkMUN8faweAsLUtD1MTXqv/view?usp=drive_link
 
Last edited:
Back
Top