Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-game Runtime API #235

Open
2 of 4 tasks
chyyran opened this issue Jul 4, 2016 · 13 comments
Open
2 of 4 tasks

In-game Runtime API #235

chyyran opened this issue Jul 4, 2016 · 13 comments

Comments

@chyyran
Copy link
Member

chyyran commented Jul 4, 2016

Similar to how the Steam overlay works, I want to be able to overlay a browser instance over the emulators Snowflake launches. However, I'm not familiar with hooking code, let alone attempting to render it over an arbitrary surface hooked into a game. If anyone is familiar with this, let me know, it'd be a big help.

Resources

Core hook entry: https://github.com/SnowflakePowered/sabinokaku
Hook impl: https://github.com/Reloaded-Project/Reloaded.Hooks
Example impl of hooking FFXIV: https://github.com/goatcorp/Dalamud
CEF hosting: https://github.com/Styr1x/Browsingway
Example impl: https://github.com/Reloaded-Project/Reloaded-II
In-process hosting: https://gitlab.com/kaminariss/nextui-plugin/
hooking input on linux: https://tronche.com/gui/x/xlib/event-handling/XSelectInput.html
sharing resources between dx11/dx12: https://stackoverflow.com/questions/52869111/sharing-id3d11buffer-and-id3d12resource
GL_EXT_memory_object_win32/GL_EXT_memory_object for OpenGL buffer sharing. May be possible to offprocess chrome, render CEF to texture then paint.
KMT: https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_win32_keyed_mutex.txt
https://www.intel.com/content/www/us/en/developer/articles/technical/sharing-surfaces-between-opencl-and-directx-11-on-intel-processor-graphics.html
https://github.com/flightlessmango/MangoHud/blob/master/src/vulkan.cpp#L1581
https://blog.techlab-xe.net/post-5439/
vk ex: https://github.com/scenerygraphics/scenery/blob/master/src/main/kotlin/graphics/scenery/controls/Hololens.kt#L232

Todo

  • DirectX 11
  • OpenGL
  • DirectX 12 (xenia)
  • Vulkan

DX9 support probably not worth maintaining.

@andres-asm
Copy link

@chyyran
Copy link
Member Author

chyyran commented Jul 23, 2016

I've looked into that, and actually got a Bitmap rendering on top of an arbitrary RetroArch instance, but I couldn't get CEF to initialize properly and render to it.

@andres-asm
Copy link

what do you mean with CEF?

@chyyran
Copy link
Member Author

chyyran commented Jul 4, 2017 via email

@chyyran
Copy link
Member Author

chyyran commented Jul 4, 2017

To clarify: I need to be able to render the webpage through CEF on to the injected surface, and be able to pass input to the instance of CEF so that users can interact with the webpage. This will be used to build an ingame-UI framework of sorts, and be able to control launched applications through a socket interface/message passing/some other hacky method abstracted away.

The Steam Overlay is not built in CEF, but does allow rendering of a CEF instance when using the ingame web browser.

It doesn't have to be done in managed code (C#), but should be able to be invoked through some standard calling convention (so probably C).

@iongion
Copy link

iongion commented Jan 10, 2018

Did you guys find a solution to this ?

@chyyran
Copy link
Member Author

chyyran commented Jan 10, 2018 via email

@chyyran
Copy link
Member Author

chyyran commented Jan 24, 2022

So.. after playing some multi-disc games I have come to the conclusion that an ergonomic API for this is rather necessary UX wise. There is no other way to properly swap games without requiring the user memorize some hotkeys and this is of course not acceptable. Interfacing with the emulator process can be done easily via window messaging but we need an overlay UX.

@chyyran
Copy link
Member Author

chyyran commented Jan 29, 2022

Work in #836

@chyyran
Copy link
Member Author

chyyran commented Feb 5, 2022

dropping this here

image

@chyyran
Copy link
Member Author

chyyran commented Feb 14, 2022

Seems like while DX11 shared resources work fine, there's not much information in sharing ID3D11Texture2D with DirectX12 or OpenGL resources, which I need for interprocess shared resource. Ideal here would be to use either Vulkan or DX12 which can interop with DX11 natively, and OGL with Ext_mem_obj_w32.

Hosting CEF in-process is another option but I'd like to avoid that

@chyyran
Copy link
Member Author

chyyran commented Feb 17, 2022

DX12 is trivial-ish since it can be done with the same loader. Vulkan is just weird so I'm probably going to have to build a mini-layer in https://github.com/SnowflakePowered/sabinokaku and inject CLR that way.

@chyyran
Copy link
Member Author

chyyran commented Mar 1, 2022

Investigating native-only single DLL solution in https://github.com/SnowflakePowered/snowflake-ingame

@chyyran chyyran pinned this issue Sep 5, 2022
@chyyran chyyran changed the title Inject and overlay a Chromium browser instance on top of OpenGL/DirectX surface In-game Runtime API Sep 5, 2022
@chyyran chyyran added the devel label Sep 5, 2022
@chyyran chyyran added this to the API 1.0 milestone Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants