Skip to content

Quick and dirty example of DesktopDuplication API with DearImGui

License

Notifications You must be signed in to change notification settings

kotae4/D3D11_DesktopDuplication

Repository files navigation

D3D11_DesktopDuplication

Quick and dirty example of using the Desktop Duplication API to grab the desktop image and then rendering it with imgui.
Started with the example_win32_directx11 project that comes with imgui and then cobbled the rest together using other people's work.

Helpful Links

First 6 can be summarized as "all of MSDN documentation" but these particular pages were the most relevant.

Building

You need winsdk installed in order for the d3d stuff to be present.
You also need a device that supports most of the d3d feature levels.

Running

You have to click 'Reload Outputs' button, I am a lazy programmer.
You then have to click and select one of the outputs even though a default output is selected. It isn't actually selected until you click on it. Again, bad programmer here.
After you do that it should start rendering the desktop image directly below the FPS text.

The console window will have some debug messages. It might spam you, that's not good.

There might be resource leaks so don't leave this running 24/7.
What are CComPtrs? Sounds like 'good programmer' things, so it's not for me.

running the thing
Image: Running the Thing

About

Quick and dirty example of DesktopDuplication API with DearImGui

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published