• Advertisement

Archived

This topic is now archived and is closed to further replies.

Direct3D in a window

This topic is 6382 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have succesfully made D3D run in a window. However, the user will be able to resize the window. Thats means I''ll have to recreate my back buffer and my z-buffer. However, I will also have to recreate my 3D device so i can attach it to my new back buffer. Is there a way to attach the new back buffer to the device without having to recreate it? I''m also trying to find the coordinates of the cliet window in terms of the screen . Right now I''m just using GetWindowRect, but thats not too accurate, And GetClientRect basically just gives me the width and height of the client area, not its screen coordinates. ======================================= A man with no head is still a man. A head with no man is plain freaky.

Share this post


Link to post
Share on other sites
Advertisement
I can''t help you with your first question, but for the second you might want to check out ScreenToClient() or ClientToScreen() Win32 functions.
If you want to know the size of the border you could use AdjustWindowRect();

Share this post


Link to post
Share on other sites
I have tried using the ScreenToClient() and ClientToScreen() functions, but they seem to crash on me for some reason. Right now I'm finding the client coordinates by using GetWindowRect() combined with GetSystemMetrics(SM_CXFRAME) and GetSystemMetrics(SM_CYCAPTION)

but i just wanted to know if there was a simpiler way.

Edited by - Zipster on August 27, 2000 9:37:34 PM

Share this post


Link to post
Share on other sites
Are you sure you gave the pointer to the POINT structure, when calling ClientToScreen/ScreenToClient?

Oh, and the AdjustWindowRectEx() is used to do calculations on the frame-size for windows with an extended window style.

Share this post


Link to post
Share on other sites
Yes, i typecasted with this, (POINT*) , and I know see that Andre LaMothe recommends AdjustWindowRectEx(). I''ll try it, but I''ll most likely stick with fullscreen. Who would run D3D in a window?

=======================================
A man with no head is still a man.
A head with no man is plain freaky.

Share this post


Link to post
Share on other sites

  • Advertisement