Windows exe capture - libretro core for RetroArch

WINDOWS EXE CAPTURE - experimental libretro core for RetroArch Version 1.9-wgc

WHAT IT IS

An experimental RetroArch core that launches a Windows program (.exe), captures its window and shows it inside RetroArch, so you can apply RetroArch shaders (CRT, scanlines, etc.) to it, in a way similar to ShaderGlass.

Video is captured with Windows Graphics Capture (WGC). If WGC fails to start, the core automatically falls back to PrintWindow.

Audio does not go through RetroArch: the game’s sound comes out directly from the game itself (the core only sends silence to RetroArch). Save states are not supported.

See readme.txt in 7z file for usage e troubleshooting

New in version 1.9: restart windows programs with retroarch restart command

5 Likes

Nice.

Got it working and with smooth frame pacing too (at least as far as AM2R is concerned -haven’t tested with anything else yet).

First, I switched to glcore. With Vulkan I’m unable to get smooth frame pacing with this core for some reason.

Second, disable vsync in RetroArch but enable it in the game/application itself (as always, with RA you can save core-specific .cfg settings so you don’t have to manually change them depending on the core every time).

So for this core, what worked for me:

  • glcore video driver
  • disable vsync in RA / enable it for the game application
  • run the exe/application in a window.
3 Likes

This is… quite intriguing. Thank you, OP, for this!

1 Like

Alright, first problem:

I start a game using the core, and the focus remains always on the game’s individual window. ctrl+shift+F12 will put the focus on Retroarch and the shader I am running, but the game pauses, and I cannot play. I have all the UI pauses turned off that I know of. When I press ctrl+shift+f12 again, it returns to the game window, and the shaders, etc., vanish, to the retroarch window (which I cannot alt tab to).

Ideas?

It is normal for the game to pause when you enter menu mode in Retroarch; this allows you to change the settings at your leisure whilst the game waits to be restarted in game mode.

As for the issue you’ve highlighted: try switching the game to windowed mode via the game’s own settings; read the readme file to understand the options and how to troubleshoot problems.

New version 1.7.

What’s new

1.3-wgc

  • Shortcut (.lnk) support in Load Content. The core reads the program, arguments and start folder from the shortcut and uses them to launch the game.
  • The core info now declares exe|lnk. If RetroArch does not list lnk, delete or rename its core-info cache file (with RetroArch closed) so the new .info is read.

1.4-wgc

  • New options Window base size and Window size multiplier: the core resizes the game window to base × multiplier (for example 320x240 × 1) so the capture starts from an integer multiple of the original resolution.
  • Off by default. Applies only to resizable windows (not dialog windows), once per window, after about 2 seconds; changing the option in the menu re-applies it immediately.

1.5-wgc

  • New option Windows scaling for the game (default: Off). With Off the game is launched without Windows display scaling (for example the 125% used on many laptops), so its window keeps its real size and the capture is not blurred by Windows before the shaders. It works like Properties → Compatibility → High DPI settings → Application, but automatically and only for the launched process. Takes effect at the next launch.

1.6-wgc

  • Attach to a game that is already running. Load Content on an .exe or shortcut whose program is already open with a visible window, and the core captures that window instead of launching a second copy. This is particularly useful for games that first open a launcher with various options and only then launch the game itself.
  • The Windows scaling for the game option does not affect a game that was already open (the scaling is decided at launch).

1.7-wgc

  • A game the core attached to (already running before you loaded the content) is now closed when you close the content in RetroArch, exactly like a game launched by the core.

https://drive.google.com/file/d/1O2Y8lt95xqTR7jL70KewmRhYIlG_ihht/view

2 Likes

It was making the game windowed that did the trick. Though I had set the game to be in a window, it switched from window to full after reaching the title screen every time.

So after playing around some more, noticed there’s some framerate jitter, which makes playing vertical TATE mode Shmups pretty difficult.

I switched to WindowCast Core and the framerate jitter vanished, and they played butter smooth.

Not sure what is causing the jitter in your core, but I’m using the exact same shaders that I use for WindowCast.

Probably some further optimization is needed.

Seems great, however, so far! I like how much easier it is to get a external game up and running and into shaders, versus WindowCast.

Try changing video driver, d3d11 should be the fastest.

(Note: I only tested/played this on the 1st release of WEC -haven’t had the chance to test the newer releases yet).

So, earlier I mentioned the game/exe needed to run in a window in order for me to see anything other than a black screen.

Well, turns out, that was incorrect: The game can be played when it’s configured to use fullscreen without any blackscreen issue with WEC…the issue only occurred when both RA’s start resolution and the game’s resolution were the same.

For example if I started RetroArch at 1280x720 and the game’s fullscreen resolution was also set at 1280x720…then I’d get a black screen. But if I start RA at 1920x1080 beforehand then it would display correctly (it switches to the game’s resolution before starting).

Guessing but, it seems when both the core and RA’s fullscreen resolutions are the same, the core doesn’t have time to update something hence the black screen. Again, just guessing and the issue is fairly trivial to circumvent so not a major issue.

Can you add option to also capture screens… I need use OBS to see game in terminal…

Updated to version 1.8 in the opening post.

Improvements and new shortcuts (old ones don’t work anymore).

New option: borderless full screen for the game (Ctrl + Alt + Shift + Del). This works particularly well for games with 3D graphics. See README and WHAT’S NEW for details

3 Likes