If you are going to write a Visual DLL will the visual aspects of such dll appear ingame? i mean, if you wanted to add a new shop window for example. Could this be achieved by creating a DLL with a UI and hooking it to the game?
Printable View
If you are going to write a Visual DLL will the visual aspects of such dll appear ingame? i mean, if you wanted to add a new shop window for example. Could this be achieved by creating a DLL with a UI and hooking it to the game?
no, only if u used the same method as the client
I'm not sure that's completely true. There are a number of methods you could use.
- Pass a handle to the windows DC to the DLL, and tell it when to "paint" (only after all normal drawings have completed and the buffer flip has happened", your UI will lag and flicker)
- Pass a handle to the window and change it to MDI from SDI window. (the DLL can then create "document" windows in the main window, and even apply transparent "skin" to them and Windows GDI will do the rest... not really game grade, but the same as we put up with on the desktop)
- Lock a GDI+ alpha blend transparency on to the windows client area as a child object. (you can update that with whatever you like, and it's a bit like having an interactive transparency gel over your TV... or "chroma key", frame updates will operate independently)
- If you know you have at least SM1, you can probably hook an HLSL post-process renderer over the DirectX rendering, usually used for DOF, Night Vision, SFX, Drunk Mode, Motion Blur etc... but it's been used for HUD interfaces before)
- Make a new transparent window from the DLL with the same dimentions and location as the host apps main window, track changes to it and mirror them, and work on that window as you like. (same effect as adding GDI+ transparent layer but at GDI level, while UI may lag by a frame if you move or resize the window, but you wouldn't see it fullscreen)
- Hook or catch DirectX API calls and use them to trigger additional ones of your own. (as Sheen suggested)