Forums
December 14, 2017, 07:05 PM

Author Topic: D3D9Wnd 0.7 - a native, Direct3D 9-based windowed mode and multi-monitor support  (Read 35470 times)

0 Members and 1 Guest are viewing this topic.

This is great! Thanks a lot
« Last Edit: November 26, 2013, 01:51 PM by Christian »

Offline StepS

D3D9Wnd 0.6.0.0 released!
« Reply #61 on: May 22, 2014, 07:23 PM »
A new update has been released: 0.6.0.0.
  • D3D9Wnd is now fully version-independent. This means that it will work on any future version of W:A that supports Direct3D 9 (but still requires at least 3.7 or newer, as older versions don't have Direct3D 9) without having to wait for me to update the module.
  • You can now load D3D9Wnd with any wormkit module loader, not only the built-in option of the game.
  • Implemented fix for the long-living W:A crash when you press Ctrl+Alt+Del, Win+L or get an UAC pop-up  on Vista and newer (thanks to Deadcode for the solution; the fix will also be available in the next W:A update).
  • Added a FancyStartup option for the frontend initialization. With this setting, W:A will start up translucent, quickly becoming opaque.
  • The module will now set W:A's process DPI-aware. This resolves clipping/stretching/blurriness/mouse issues that come out of the DPI virtualization system in Vista and newer (especially important for Windows 8.1 users who use a DPI scaling value other than 100% and 125%).
  • The Fullscreen frontend mode will now use native fullscreen.
  • The module will now only start activity after the Direct3D 9 interface creation, related to which the check for DirectDraw/Direct3D7 is now done in a better way, as well as a lot of other things.
  • Assisted Vsync no longer makes the game laggy when the game's height is taller than your primary monitor's height, therefore it won't be auto-disabled now.
  • You should no longer see an empty mouse cursor when returning to frontend from the game with Hardware Cursors enabled and unpinning being used prior to the return.
  • Mouse clipping will now correctly work when running Stretched/Centered/Custom frontend with wkSuperFrontend module.
  • Previously you could see a black rectangle for a split second when W:A's frontend was starting up. Technically now it's done in the best way though it may feel a little bit unusual for people who got accustomed to it already.
  • Many optimizations and improvements.
  • Added a secret feature.

0.6.0.3: minor transparency/FancyStartup fixes
0.6.0.4: FancyStartup will not appear in replays now
0.6.0.5: Fixes for the in-game camera movements when wkSuperFrontend's large frontend is active.
0.6.0.6: Added a FullscreenAlternative option. This is the artificial (non-exclusive) fullscreen that was in the module prior to 0.6.0.0 (but has since been improved a bit). This is useful to eliminate various exclusive fullscreen issues such as Windows 7 Aero multi-monitor flickering issues. Note: this setting takes priority over the vanilla Fullscreen.
0.6.0.7: Changed the way the D3DDevice9 Present hook works. This solves compatibility with all other apps that hook rendering, such as Fraps.
0.6.0.8: Minor fixes to the module's exiting phase.
0.6.0.9: The module will now check if the fullscreen resolution required for frontend is supported by the system. In case of a failure, a warning will be shown, telling the details, and the module will then switch to windowed mode. This is for both standard and alternative fullscreen modes. Useful to determine whether a CreateDevice failure in unmodified game was actually a screen mode switch failure.

Coming soon:
  • Ability to resize the in-game window: I have already done this for Worms 2 (see the video | download), and almost finished for W:A, though it won't be progressive at first (it's best to keep it as is, when the resizing stops only).
  • Alt+Enter support: this will have multiple variations. In the first mode, pressing Alt+Enter would switch between exclusive fullscreen and windowed mode display; in the second mode, Alt+Enter would stretch/shrink the window; and in the third mode Alt+Enter would take advantage of the aforementioned window resizing, expanding the borderless windowed display to the whole desktop resolution.
  • A "proper" frontend window that you can move.
  • Multi-monitor improvements.
  • Some other things.
« Last Edit: May 28, 2014, 09:36 PM by StepS »
Dec 30 2013 23:59:44 <StepS> windowed mode isn't the only thing you need about frontend
Dec 30 2013 23:59:49 <StepS> you need it to be actually bigger
Dec 31 2013 00:00:13 <StepS> it actually is very small on my 15-inch full HD screen
Dec 31 2013 00:00:25 <StepS> while running at 640x480 or stretched mode makes it fuzzy
Dec 31 2013 00:00:44 <StepS> this problem has been around since the Worms Armageddon's release and no one has even tried to beat it
[...]

Offline rongyao

A small bug!

Using d3d9wnd in combination with superfrontend, causes hardware mouse to not stay inside the frontend window!

D3d9wnd settings
Quote
[Misc]
EnableModule=1
StaticWindowClass=1
NoTopmost=1
FancyStartup=0

[FrontendSettings]
Fullscreen=0
FullscreenAlternative=0
Stretch=0
Centered=1
RunInBackground=1
EnableCustomSize=1
Xsize=800
Ysize=600

[InGameSettings]
WindowBorder=1
Stretch=0
QuickInfo=1
ActiveBackground=1
TopLeftPosition=0
AutoUnpin=1

[MultiMonitor]
Monitors=2
EnableInFrontend=0
EnableInGame=0
AutoSetResolution=1

Super frontend settings!
Quote
[SuperFrontend]
EnableModule=1
FrontendWidth=800
FrontendHeight=600
AdjustDebris=1

Ingame resolution from registry is set to 800x600 too.

The ingame mouse cursor that is worms colored one stays inside, but the windows cursor in meanwhile i move the game one moves behind worms window and clicks folders or points stuff on the desktop, remaining active there.

If i disable superfrontend it works perfectly fine but the default frontend resolution is not very good.

Also a request, may we get a border on the frontend window too? So to be able to move it around as i can do with the game window if border is enabled.

Update: Ah superfrontend makes the frontend mouse to remain locked inside the invisible window 800x600 square but on top left side of  the screen.
So centering frontend window in combination with superfrontend and the fact windows mouse is not disabled, causes the glitch where mouse is released behind and interacts with screen objects and applications.

Another question, when wkresolution gets released, does wkresolution, wksuperfronted and wkd3d9wnd will get merged into one plugin in near future or they will stay as separate plugins?

Video representing the bug. https://drive.google.com/file/d/0B7MS086qw3wgN0xGLUZNVnlsaVE/edit?usp=sharing
« Last Edit: June 03, 2014, 02:26 PM by rongyao »

Offline StepS

The ingame mouse cursor that is worms colored one stays inside, but the windows cursor in meanwhile i move the game one moves behind worms window and clicks folders or points stuff on the desktop, remaining active there.
I have already explained why this happens, and why there's no window border in frontend. It's not my bug, it's the abomination of team17's DXMFC rendering hybrid for all frontend screens that causes it to render graphics for the controls relative to the screen corner, not the window's corner. I still haven't found where and how to fix it. Currently the secondary window with all mfc controls remains in the corner even when what you see is centered, which causes these problems.
It's not superfrontend which causes the issue. It's simply that there are gaps around the default 640x480 controls area when it's active, and no gaps to hide cursor when it isn't active (if you click something in the top left corner normally, you'll see cursor flashing for a bit when switching the screens)
The solution is simple: don't use centering.

Another question, when wkresolution gets released, does wkresolution, wksuperfronted and wkd3d9wnd will get merged into one plugin in near future or they will stay as separate plugins?
wkReSolution is for Worms2. super frontend is currently still under testing phase, and has not been announced officially, it's just a quick hack to change the frontend's dimensions. They won't be merged as one can be used independently of the other, and also superfrontend will likely always stay version-dependent unlike D3D9Wnd.
« Last Edit: June 04, 2014, 08:59 AM by StepS »
Dec 30 2013 23:59:44 <StepS> windowed mode isn't the only thing you need about frontend
Dec 30 2013 23:59:49 <StepS> you need it to be actually bigger
Dec 31 2013 00:00:13 <StepS> it actually is very small on my 15-inch full HD screen
Dec 31 2013 00:00:25 <StepS> while running at 640x480 or stretched mode makes it fuzzy
Dec 31 2013 00:00:44 <StepS> this problem has been around since the Worms Armageddon's release and no one has even tried to beat it
[...]

Offline Nonentity

  • World record holder for the longest Mexican Flip
  • Hero Member
  • *****

  • Norway Norway
  • sX sX clan

  • Posts: 517
    • View Profile
I have a couple of suggestions for this module.
1: [FrontendSettings] (there might be some limitations that I'm not aware of, but I think it should work with hardware cursor disabled)
Xposition=
Yposition=

[InGameSettings]
disable=1 (windowed frontend is really useful, but I don't need to change any in-game settings, and I feel like it adds some input lag, disabling aero might help with that, tho)
forcevsync=0 (not sure if this is still a thing, haven't tested the latest version)

Just some more suggestions to improve the module, really awesome if it gets added.

yo there x) i`m back!
sry for offtop. cool module btw. I`ll get w:a on steam soon and will be back i guess :D
Will it work with steam version of w:a btw?

Offline StepS

Just some more suggestions to improve the module, really awesome if it gets added.
answered in pm

yo there x) i`m back!
sry for offtop. cool module btw. I`ll get w:a on steam soon and will be back i guess :D
Will it work with steam version of w:a btw?
yes. Also in version 0.6.1.2 I have fixed compatibility with steam overlay (where hooks would conflict) so that it now works properly
Dec 30 2013 23:59:44 <StepS> windowed mode isn't the only thing you need about frontend
Dec 30 2013 23:59:49 <StepS> you need it to be actually bigger
Dec 31 2013 00:00:13 <StepS> it actually is very small on my 15-inch full HD screen
Dec 31 2013 00:00:25 <StepS> while running at 640x480 or stretched mode makes it fuzzy
Dec 31 2013 00:00:44 <StepS> this problem has been around since the Worms Armageddon's release and no one has even tried to beat it
[...]

Offline rongyao

Thank you for the replies! ^^

Also one request here. Ability to choose 0 width and 0 height for frontend resolution in d3d9wnd.ini for windowed mode, which to get current desktop resolution and set it automatically. Fake fullscreen kind of a thing. Or automatically to get worms armageddon resolution from registry and set them to the frontend if width and height are set to 0, that will be even better i think.

Offline StepS

Ability to choose 0 width and 0 height for frontend resolution in d3d9wnd.ini for windowed mode, which to get current desktop resolution and set it automatically.
This is what SuperFrontend already does: when the sizes are set to 0, you get your desktop resolution. This is the default in the ini file you get from the website.
If you simply want to stretch it, that's what the "Stretch" option does: fills your whole screen.
« Last Edit: June 07, 2014, 04:54 PM by StepS »
Dec 30 2013 23:59:44 <StepS> windowed mode isn't the only thing you need about frontend
Dec 30 2013 23:59:49 <StepS> you need it to be actually bigger
Dec 31 2013 00:00:13 <StepS> it actually is very small on my 15-inch full HD screen
Dec 31 2013 00:00:25 <StepS> while running at 640x480 or stretched mode makes it fuzzy
Dec 31 2013 00:00:44 <StepS> this problem has been around since the Worms Armageddon's release and no one has even tried to beat it
[...]

Offline StepS

A new update has been released: 0.6.6.6. This update is awesome and everyone who is using an older version must upgrade. More details on that later.
What's new?
  • Added a SoundInBackground feature. This will let the game play sounds even when it's not in focus. Now enabled by default.
  • Multi-monitor settings have been improved. Now the preferred amount of monitors is "Max" that autodetects entire virtual desktop, and the "EnableInFrontend" option has been disabled as it was totally useless. Also, it's no longer necessary to change the alignment of your monitors. Even if your primary one is not on the top or left, you will still be able to play in multi-mon now.
  • Window dragging is now nicer. When cursor is unpinned, you can drag and move the window from anywhere inside the window, not just from the window caption. Very useful for quick moving with Ctrl+G. This only works if there's a border around the window.
  • Fixed the game using a lot of CPU when minimized (and potentially causing a crash on return to the frontend afterwards) if active background was on (mostly). Also, now there's no minimize button on the caption, it was causing bugs. Use the keyboard combos for minimizing the game, or the escape menu option.
  • Active background and automatic cursor unpinning are now always enabled. These two options have become essential technologies that would be both nonsensical and problem-causing if disabled.
  • Fixed the bug where in-game stretch resolution would not properly be reapplied after playing one match and then another one with Fullscreen frontend enabled. Thanks to Senator for the report.
  • Fixed the bug where super-resolution assisted vsync would lag the game after playing one match and then another one, or using Ctrl+Alt+Del/Winlock and returning back. Thanks to Kaleu and Zexorz for the reports.
  • Module now works without additional DLLs.
  • Some other things and fixes. :​)

Happy Halloween!
« Last Edit: November 01, 2014, 06:19 PM by StepS »
Dec 30 2013 23:59:44 <StepS> windowed mode isn't the only thing you need about frontend
Dec 30 2013 23:59:49 <StepS> you need it to be actually bigger
Dec 31 2013 00:00:13 <StepS> it actually is very small on my 15-inch full HD screen
Dec 31 2013 00:00:25 <StepS> while running at 640x480 or stretched mode makes it fuzzy
Dec 31 2013 00:00:44 <StepS> this problem has been around since the Worms Armageddon's release and no one has even tried to beat it
[...]

Offline Kaleu

Thanks StepS.
666 Satanael \,,,/
Experience the best TTRR gameplays with my maps!

→ The best of Kaleu ←

Offline StorminASU

Hello All!
   I recently purchased W:A which is the first and only game I've bought from Steam, but I couldn't pass up the sentimental value of owning it again.  However, I do have a bad habit of "multitasking" at work and need to figure out a way to play W:A without taking up the whole screen and at any time being able to click focus on something in the background and having the game go away: similar to if you're surfing the internet, you minimize the window a little, keep something up behind it to click on in case someone walks in.  Is this possible?

I've tried to download d3d9wnd and make it work, but I can't figure it out because I'm so unfamiliar with registry options and I don't understand what frontend, etc. refer to.  TIA!!!

Offline j0e

Quote from: StorminASU
I've tried to download d3d9wnd and make it work, but I can't figure it out because I'm so unfamiliar with registry options and I don't understand what frontend, etc. refer to.  TIA!!!
When editing D3D9Wnd.ini, 0=Off, and 1=On.

"FrontendSettings" refers to the menu system. Anything with the blue background and floating stars basically. Knowing this, combined with knowing the above (0=Off, 1=On) the options are reasonably self-explanatory.

"InGameSettings" controls everything in the actual game.

The "InGameSettings" are a bit difficult to understand at first. As long as you know that with D3d9wnd enabled all aspects of the game are 'windowed' by default, it makes sense. It's only when the Desktop Resolution of the player matches his or her In-Game-configured setting, that the In-Game portion runs in fullscreen.

To achieve what you want to do, you need "Stretch=0" under the InGameSettings, and then in the regular WA options, set a smaller resolution than your regular desktop resolution. For example, most computers use 1366x768 as their default resolution, so you might set WA to use 1024x768, so you can click out of the game on the sides.

Just so you know, since WA makes use of the mouse to control the game's camera, you first will need to press "Ctrl+G" to un-pin the mouse, and then click outside of the window. Alternatively, Windows+D, Windows+M, or Shift+Esc will minimize the game quickly at any time (with or without D3D9Wnd).

To minimize the windowed frontend quickly, you have to press Windows+D or M. Clicking outside the frontend window doesn't make it go away, since it's Always-on-top for some reason.

My recommendation: find some free software that will let you remap Windows+D to an easier single-button shortcut, for when your boss walks in. I know AutoHotKey can do this, but it's extremely confusing.

Getting D3D9Wnd was smart because now minimizing from the Frontend doesn't force your monitor to switch resolutions, so minimizing will be instant, instead of the usual 2-5 second lag.

Edited for clarity.
« Last Edit: December 11, 2014, 06:27 AM by j0e »

Offline StorminASU

Quote from: StorminASU
I've tried to download d3d9wnd and make it work, but I can't figure it out because I'm so unfamiliar with registry options and I don't understand what frontend, etc. refer to.  TIA!!!
When editing D3D9Wnd.ini, 0=Off, and 1=On.

"FrontendSettings" refers to the menu system. Anything with the blue background and floating stars basically. Knowing this, combined with knowing the above (0=Off, 1=On) the options are reasonably self-explanatory.

"InGameSettings" controls everything in the actual game.

The "InGameSettings" are quite confusing in my opinion. There should be a setting to explicitly enable windowed mode in-game. Eg. "Windowed=1". And I'd like to see Comments added with a brief description of what each setting does.

To achieve what you want to do, you need "Stretch=0" under the InGameSettings, and then in the regular WA options, set a smaller resolution than your regular desktop resolution. For example, most computers use 1366x768 as their default resolution, so you might set WA to use 1024x768, so you can click out of the game on the sides.

Just so you know, since WA makes use of the mouse to control the game's camera, you first will need to press "Ctrl+G" to un-pin the mouse, and then click outside of the window. Alternatively, Windows+D, Windows+M, or Shift+Esc will minimize the game quickly at any time (with or without D3D9Wnd).

To minimize the windowed frontend quickly, you have to press Windows+D or M. Clicking outside the frontend window doesn't make it go away, since it's Always-on-top for some reason.

My recommendation: find some free software that will let you remap Windows+D to an easier single-button shortcut, for when your boss walks in. I know AutoHotKey can do this, but it's extremely confusing.

Getting D3D9Wnd was smart because now minimizing from the Frontend doesn't force your monitor to switch resolutions, so minimizing will be instant, instead of the usual 2-5 second lag.

Thank you so much for the very detailed answer and all your help.  I tried implementing your suggestions, but there's still a lag when I open the game and it displays (also when I quit the game, etc), and it still takes up the entire screen.  I've copy and pasted my d3d9wnd settings below:
[Misc]
EnableModule=1
StaticWindowClass=1
NoTopmost=1
SoundInBackground=1
FancyStartup=0

[FrontendSettings]
Fullscreen=0
FullscreenAlternative=0
Stretch=0
Centered=0
RunInBackground=1
EnableCustomSize=0
Xsize=640
Ysize=480

[InGameSettings]
WindowBorder=1
Stretch=0
QuickInfo=1
TopLeftPosition=0

[MultiMonitor]
Monitors=Max
Enable=0
AutoSetResolution=1



Offline j0e

Hey storminASU. Your settings look fine.

But it doesn't sound like d3d9wnd is doing anything. I'm guessing the frontend (menus) are probably still full-screen, etc. That means one of two things: either D3D9Wnd is not enabled yet in WA Advanced Settings, or it's installed in the wrong folder. Make sure this option is ticked:


If you've enabled the above option but d3d9wnd is still not working, that means it's probably installed wrong. D3d9wnd has to be extracted (unzipped) into the base Worms Armageddon folder.

For Steam users the base WA folder is something like:
C:\Program Files (x86)\Steam\steamapps\common\Worms Armageddon

and for CD Rom or pirate users something like
C:\Microprose\Worms Armageddon


After you get the module working, you can tweak various settings, like increasing the size of the frontend to make the words easier to read, etc. EnableCustomSize is the one for that.