Steamworks fails to get window handle for showing overlay

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
dart_theg
Posts: 53
Joined: Sun Dec 29, 2024 3:13 am

Steamworks fails to get window handle for showing overlay

Post by dart_theg »

I am using the Steamworks SDK to add Steam to my game. I run SteamAPI_Init() etc., success, all before the device and window are created.
But the Steam overlay never appears. I run SteamAPI_RunCallbacks per frame...
Anyone know much about this? I'm just assuming Steam is failing to get the handle or something? I put my Irrlicht device in a GLFW window, though their window handles are the same ID. Even running Irrlicht in OPENGL, it's the same.

EDIT: It's because I'm making a glfw window and setting window ID of the new device to the glfw window. Not sure how I will go about fixing this...
Noiecity
Posts: 314
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Steamworks fails to get window handle for showing overlay

Post by Noiecity »

chadgpt wrote:The Steam overlay must be able to "inject" itself before the renderer (DirectX/OpenGL/Vulkan) has already initialized/hooked graphics functions. If your app creates a GL/D3D context (for example, by creating a GLFW window or creating the Irrlicht device with context) before Steam has been able to hook itself, the overlay will not be displayed.

Be sure to run the .exe from the Steam client (add it as a “Non-Steam Game” for testing if it is not published). This ensures reliable injection by Steam. Check in Task Manager that gameoverlayui.exe appears when you launch from Steam.

https://community.monogame.net/t/steam- ... e-3-6/8926

Call SteamAPI_Init() before initializing any graphics.

SteamAPI_Init() before glfwInit() / glfwCreateWindow() / IrrlichtDevice creation / D3D/VK/OpenGL context creation. The official documentation indicates this.

https://partner.steamgames.com/doc/features/overlay

Do not create or initialize the OpenGL/D3D context with GLFW (or any other library) before initializing Steam.

https://steamcommunity.com/discussions/ ... 555999968/
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
dart_theg
Posts: 53
Joined: Sun Dec 29, 2024 3:13 am

Re: Steamworks fails to get window handle for showing overlay

Post by dart_theg »

Works, thanks!
dart_theg
Posts: 53
Joined: Sun Dec 29, 2024 3:13 am

Re: Steamworks fails to get window handle for showing overlay

Post by dart_theg »

Hm, well I do init steam before any graphics but I find that I have to create the irrlicht device without using the glfw handle as its parent. Then right after I can parent it. Works but now to see the window show up for a second before being parented…

Supposedly this is because since Irrlicht does the actual rendering for my game, but uses a glfw window for encapsulating etc, Steam fails to hook onto the device if it goes straight to being under the glfw window.
CuteAlien
Admin
Posts: 9926
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Steamworks fails to get window handle for showing overlay

Post by CuteAlien »

I haven't worked with SteamAPI yet. But maybe you can use SExposedVideoData is some way to set the handle later? Check the Win32Window example.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply