Archived

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

DirectX Windowed?

This topic is 5587 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''m working on my DirectDraw wrapper class and added support for Windowed mode yesterday night. I''ve created primary buffer, resize the screen during init. If you call init with 640, 480 as parameters the window gets resized to that. But now I have one problem, what to do with the secondary buffer? I create an offscreen plain in the size of 640*480. I use blit to push it to the primary buffer. However, if I make an mistake I blit it over the wrong portion of the screen. How do I blit EXACTLY to the windows client area? Sand Hawk ---------------- -Earth is 98% full. Please delete anybody you can.
My Site

Share this post


Link to post
Share on other sites
This function retrieves the coordinates of a window s client area.

BOOL GetClientRect(
HWND hWnd,
LPRECT lpRect
);
Parameters
hWnd
Handle to the window whose client coordinates are to be retrieved.
lpRect
Long pointer to a RECT structure that receives the client coordinates. The left and top members are zero. The right and bottom members contain the width and height of the window.
Return Values
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks
Command bars are included in the client area.

Share this post


Link to post
Share on other sites
To find out what your clients 0,0 screen coordinate would be you could do:


POINT ptTopLeft= { 0, 0};

ClientToScreen( hwnd, //your window
&ptTopLeft );


Then use the GetClientRect extents to find where you should blit to from there.

Share this post


Link to post
Share on other sites