Hi-
I am using Direct2D 11, and I have created a window class that initializes its own D2D factory and a render target for the window handle, on its own thread. I have a message pump going in the thread function and it works fine if I dont use Direct2D - if i just launch the window on a new UI thread and paint with Win32. If I use D2D, I get a blank, transparent region where the window should be. Not exactly sure how to debug this.
I have been piecing together pieces from the internet (https://docs.microsoft.com/en-us/windows/win32/direct2d/server-side-rendering-overview?redirectedfrom=MSDN#multithreading and this https://docs.microsoft.com/en-us/windows/win32/direct2d/multi-threaded-direct2d-apps). The second one mentions D3 which I am not using.
I am not doing anything special:
- Create thread
- In thread function create the window, the factory and create the message loop.
- Paint to the render target in the WM_PAINT message.
- Paint a border in Win32 - this works.
I have a handler to manage the hittesting so I can resize (the window is borderless), and that isnt running which I think is related to the transparent window.
Any advice?
Thanks,
SP