Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to solve border distortion #451617
05/13/15 10:47
05/13/15 10:47
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline 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:

Click to reveal..
Code:
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);



Code:
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);




Code:
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 Offline
Expert
sivan  Offline
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:

Code:
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.

Free world editor for 3D Gamestudio: MapBuilder Editor
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 Offline OP
Serious User
Reconnoiter  Offline 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. crazy

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: Reconnoiter] #451628
05/14/15 07:32
05/14/15 07:32
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
in is fine here with Win7


Free world editor for 3D Gamestudio: MapBuilder Editor
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 Offline OP
Serious User
Reconnoiter  Offline 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 Offline OP
Serious User
Reconnoiter  Offline 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.

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1