|
3 registered members (AndrewAMD, Grant, Neb),
908
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
how to solve border distortion
#451617
05/13/15 10:47
05/13/15 10:47
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Hi all, How to prevent window distortion when moving a window with a resizeable border and buttons like close, maximize etc. ? The manual says that one can do first video_window followed by video_set to solve the problem, but that doesn't work for me and also makes everything ugly (very ugly edges around drawedlines etc.). I have tried a few things but haven't found a solution yet:
var reso_x = 1000;
var reso_y = 600;
video_window(NULL, NULL, 4+16+32+64+128, "my game");
video_set(reso_x, reso_y, 0, 0);
var reso_x = 1000;
var reso_y = 600;
video_window(NULL, NULL, 4+16+32+64+128, "my game");
reso_x -= SM_CXBORDER;
reso_y -= SM_CYBORDER;
video_set(reso_x, reso_y, 0, 0);
video_window(NULL, NULL, 4+16+32+64+128, "my game");
vec_set(screen_size,vector(1000,600,0));
etc. Anyone know how to do this?
|
|
|
Re: how to solve border distortion
[Re: Reconnoiter]
#451619
05/13/15 13:05
05/13/15 13:05
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
I played with this earlier, but don't remember exactly why I gave up... but now have a usable result: you can use an event on resizing like: on_resize = ScreenSize_Event; on_maximize = ScreenSize_Event; and in the event you can use:
void ScreenSize_Event()
{
if (video_screen==(var)2) // if windowed
{
RECT r;
GetClientRect(hWnd,&r);
video_set(r.right,r.bottom,0,0);
}
}
the 3d level is adopting fine, but 2d panels can get clipped if set smaller, or leaving uncovered border if set larger, so panels positions should be managed by this event.
Last edited by sivan; 05/13/15 13:14.
|
|
|
Re: how to solve border distortion
[Re: sivan]
#451621
05/13/15 17:18
05/13/15 17:18
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Hi Sivan, Thanks for commenting. I get ugly jagged edges when doing that the first frame or after a wait(1). I had already that code for border resize event (when you drag the border with the left mouse button) where it does work without creating jagged edges / ugly visuals but still leaving a distortion moving the window. , but for initializing it doesn't seem to work. Besides the jagged edges, the picture beneath resembles a bit the distortion problem I have when moving the window through the screen, but with me the visual error disappear after releasing the left mouse button: I have also got a problem where the close, maximize and minimize buttons are not visible till when you move the mouse cursor over that end of the border.
Last edited by Reconnoiter; 05/13/15 17:20.
|
|
|
Re: how to solve border distortion
[Re: sivan]
#451637
05/14/15 10:30
05/14/15 10:30
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
I too have windows 7 (32 bit). And now that I look at it again, models look fine. But drawn lines look really crappy. I think this is a bug with video_set+border_window: Ugly lines here cause of using video_set: Better looking lines, not using video_set but vec_set to change screen_size:
Last edited by Reconnoiter; 05/14/15 10:39.
|
|
|
Re: how to solve border distortion
[Re: Reconnoiter]
#451638
05/14/15 10:42
05/14/15 10:42
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
the differences are better visible when watching the pics at their original size (copy image url / location in the address bar). The above is not the best example, in some cases its better visible.
Last edited by Reconnoiter; 05/14/15 10:43.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|