Direct X SDK help
There is some code in the Stretch.cpp file of the DirectX 7 SDK tutorial, that I dont get. I get everything but this part
//these are of course at the top of the file
RECT destRect;
POINT pt;
//this is in the update frame function
GetClientRect(hWnd, &destRect);
if (destRect.right < 128)
destRect.right = 64;
if (destRect.bottom < 64)
destRect.bottom = 64;
pt.x = pt.y = 0;
ClientToScreen(hWnd, &pt);
OffsetRect(&destRect, pt.x, pt.y);
can someone please explain what this code does?
December 15, 2000 01:19 PM
Looks like it''s calculating the rectangle of the client area in screen coordinates, with a minimum size.
Ok thats a start but can someone explain what each function is doing? Like what is with the POINT stuff?
what does
ClientToScreen(hwnd,&pt)
and
OffsetRect(&destrect,pt.x.pt.y) do?
what does
ClientToScreen(hwnd,&pt)
and
OffsetRect(&destrect,pt.x.pt.y) do?
December 15, 2000 01:25 PM
POINT is just a 2D coordinate.
ClientToScreen converts a point from the specified window''s client coordinates to actual screen coordinates (relative to the top left of the desktop)
OffsetRect (at a guess) offsets the rectangle by the specified coordinate (i.e. adds the POINT.x to the RECT.left and RECT.right etc.)
ClientToScreen converts a point from the specified window''s client coordinates to actual screen coordinates (relative to the top left of the desktop)
OffsetRect (at a guess) offsets the rectangle by the specified coordinate (i.e. adds the POINT.x to the RECT.left and RECT.right etc.)
December 15, 2000 02:44 PM
What''s it doing with the rect afterwards? It''s probably used for the backbuffer-desktop blit, in which case isn''t used in full screen page flipping.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement