Author Topic: StretchBlit  (Read 2445 times)

0 Members and 2 Guests are viewing this topic.

Peter

  • Guest
StretchBlit
« on: January 29, 2012, 09:08:21 AM »
Deleted......
« Last Edit: May 05, 2015, 12:05:45 PM by Peter »

Charles Pegge

  • Guest
Re: StretchBlit
« Reply #1 on: January 29, 2012, 11:29:08 AM »
Hi Peter,

You can use GetClientRect to get the exact size of the client area.

And it should be possible to place the mouse sprite precisely at the  client CursorPos.

GetClientRect
(size only)
http://msdn.microsoft.com/en-us/library/aa932115.aspx

GetCursorPos
(screen coords)
http://msdn.microsoft.com/en-us/library/windows/desktop/ms648390(v=vs.85).aspx

ScreenToClient
(to get Client coords of cursor)
http://msdn.microsoft.com/en-us/library/dd162952(v=vs.85).aspx

Charles

Charles Pegge

  • Guest
Re: StretchBlit
« Reply #2 on: January 29, 2012, 11:45:35 AM »
For those who like to do several things on the PC at the same time, games in stretchable windows is a good idea :)

BTW
examples/GUI/ChildWin demonstrates how Child windows can be dynamically resized and repositioned in relation to the main client area. (adapted from an MSDN demo)

You have complete control. Locking aspect-ratios for example.

Charles

PS: I am making many assumption about your source code. I am not skilled in telepathy :)
« Last Edit: January 29, 2012, 11:50:21 AM by Charles Pegge »

Charles Pegge

  • Guest
Re: StretchBlit
« Reply #3 on: January 29, 2012, 02:16:45 PM »
I mean, when you post binaries and ask coding questions, one can only guess what is happening within the program.

Charles Pegge

  • Guest
Re: StretchBlit
« Reply #4 on: January 30, 2012, 10:50:48 AM »
Remember that we have an unseen audience. I try to keep the dialog informative even if I err on the side of stating the obvious to some of us.

Anyway Peter, the mouse/ball sprite goes out of sync with the actual cursor in the y axis, when the window is resized or made full-screen. I believe this effect can be eliminated by recalculating the x y metrics dynamically before each frame is generated.

This is what I do with Opengl Viewports - and also constrain the y/x proportion so that objects remain in proportion when the main window is stretched to a different shape.

Charles