Advertisement

Direct X SDK help

Started by December 15, 2000 01:08 PM
4 comments, last by OoMMMoO 24 years, 1 month ago
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?
Looks like it''s calculating the rectangle of the client area in screen coordinates, with a minimum size.
Advertisement
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?
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.)
So I wouldnt have to do that if I just make it fullscreen?
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