G'day again, thanks for your reply.
BEEN_Nath_58 wrote on 2025-04-20, 05:31:
Sound quite an ambitious project 😮
Reasonably so, but nothing ground-breaking 😀 I started off by porting Microsoft.DirectX.DirectDraw from 32-bit .NET Framework 1.x C# to 64-bit .NET Framework 9.0.3 C++/CLI. I legit necro'd DirectDraw 7 (for developers anyway) and was surprised, if not shocked, at how fast it is on today's systems. This is especially true when directly accessing surface memory or using many-thread blitting. Sure, you can do that on Direct3D too, but there's a lot of mucking about if that's all you're interested in doing, not to mention some abstraction. I'm working on DirectSound at the moment.
BEEN_Nath_58 wrote on 2025-04-20, 05:31:
I think you might be a little mistaken but the last hardware I saw supporting overlays was a GTX 9*7*0 on Windows 10. I think Falcosoft here showcased that, I had a thread where someone replied.
I've always had an NVIDIA GPU but for some reason I had Overlays working on Windows 7 but not on Windows 8 (and beyond). When I was running Windows 8, I believe my GPU was an NVIDIA 780. It's probable that the issue was not the driver, nor Windows, but my usage of Microsoft.DirectX.DirectDraw as opposed to "native/unmanaged" DirectDraw code.
Caps Viewer incorrectly reports Overlays as supported, but all of the associated variables describing the supported caps return a value of 0, at least on NVIDIA. My current GPU is a 4090M/12Gb.
BEEN_Nath_58 wrote on 2025-04-20, 05:31:
D3D11 renderer is used in dgVoodoo2. DDrawCompat uses the original DDraw API. Neither of which supports overlays yet. Currently only DxWnd supports overlays on GDI+ but the D3D9-DDraw chained implementation (for games like the GodFather) is unsuitable for my Nvidia (but works fine on old Intel). Although it can run plain overlay apps like mosquito.exe in DX SDK.
Looking at the DDrawCompat source suggests that D3D11 shaders are used as the renderer, at least to some degree. I haven't read the whole source. Overlays are mentioned in the source, too, so I presumed they were supported but don't have anything that will run on Windows 11 to test that, unless I wrote an app with overlays. Speaking of which, I successfully wrote a very basic DirectDraw 1.0 app which just created a device, primary surface, backbuffer and drew a red square to the screen. Did so in just under 2.2µs (much, much faster than even the best monitors/displays can update themselves).
Using DirectDraw as the renderer would really restrict the level of compatibility it could provide, since so many DirectDraw caps are no longer supported in the driver and need to be "emulated" via another API like D3D.
Actually, I just this very moment came up with a potential way that you could implement Overlays using DirectDraw 7, on even the most recent build of Windows. I'm going to try it out this evening. In Windows, you can create a window that has no title bar, no borders and is completely transparent. In addition to that, you can make it "click through", meaning that mouse clicks only affect the window underneath/behind it. This was not possible on Windows earlier than XP or maybe 2000. By making this window the DirectDraw render target, you could simulate the look and feel of Overlays. If you rendered your content onto a DirectDraw surface that had, say, a violet background, and rendered it to the primary surface using a destination ColorKey with that violet color's RGB value, it should technically be transparent and would appear, for all intents and purposes, like an Overlay. You should also be able to do this with Direct2D/3D.
The one potential caveat of his approach is that using DirectDraw you wouldn't be able to display it on top of a DirectX window which has fullscreen-exclusive mode (most games D3D11 and earlier). The voice chat program Ventrilo did this, presumably(?) with hooks or by scoping out the target window's handle, instead of creating a physical window to draw the overlay on as per my example above.
With an increasing number of games moving across to Direct3D 12 "full-screen window", this is becoming less of an issue.
BEEN_Nath_58 wrote on 2025-04-20, 05:31:
So as much I understand, MODEX used planar memory in either a banker or linear framebuffer, but XP was limited only to the banked framebuffer.
I think no GPU manufacturer was ever interested in it: hence it was phased out and never heard of again. The only available driver I see is the VBEMP implementation for Windows NT, which probably allowed PCI? era GPUs to work on XP at some level. For example Quake 2 should have worked better in MODEX.DLL form (with the MODEX mode of the game) instead of running the system on VGA.DLL
ModeX used (and still uses, if you have all the right software and hardware) planar/unbanked memory access. Windows XP, however, although it still used the XDDM-style driver model of NT 4.0 and 2000, was forced to use banked VRAM access thanks to the additional layers of hardware abstraction and "security". (Ironic considering how weak and vulnerable XP turned out to be...). This meant true Mode X (with linear, unbanked access) was/is unattainable. DirectDraw emulates ModeX on XP but in doing so, forces you into banked memory access.
I will check out that link you posted, I'm curious. It's possibly a Windows 2000 PCI driver that (like some do) works on XP.
I never ran Quake 2 in software mode (I had 3D since the Riva128/GLQuake days), but I imagine if it supported 320x240 (which would look, um, chunky 😀), I think it would have been done using the OpenGL software renderer (ref_soft.dll).
In conclusion, I'm ashamed to admit that prior to finding this thread I'd never heard of this site before. Having a close look, I am delighted to see that this is right up my alley, although my collection of classic systems consists mainly of Commodore machines (I have a C64, a 128, Amiga 600 and 1200). Most of my emulation experience resides there, too., but I've been meaning to get an old Win9x setup happening so I can play my collection of old titles that won't run on Win11 64-bit, even with compatibility flags...
The community here appears to be exceptional, too, making a refreshing change to the sometimes toxic/elitist atmosphere found elsewhere.