Original Post
🔒 Locked
DirectX in partial window
Advertisement
You could easily do this by adding a child window, in the form of an image box, panel, or other similar control (depending on what you're using, VB6, MFC, .NET, et cetera), and then using that control's HWND as the window that you tell Direct3D to draw to. Then you can resize and position that control however you want. (Note that if you don't make Direct3D's backbuffer match in size, you'll get filtering on the final result, distorting the image.)
If using Win32, I would register a new window class which "does nothing" except call DefWindowProc, and then pass the HWND of that into the call to Present().
If using WinForms, I would use a Panel (which is a blank child window) and pass its Handle into the Device.Present call to present an image into the Panel.
Make sure that you size the back buffer and viewport correctly for the child window. What I do is create a back buffer the size of the entire screen, so that I know I can handle the largest possible window without needing to re-allocate anything.
If using WinForms, I would use a Panel (which is a blank child window) and pass its Handle into the Device.Present call to present an image into the Panel.
Make sure that you size the back buffer and viewport correctly for the child window. What I do is create a back buffer the size of the entire screen, so that I know I can handle the largest possible window without needing to re-allocate anything.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement