Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TedMar, AndrewAMD), 1,344 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Error when switching to window mode #370487
05/13/11 15:06
05/13/11 15:06
Joined: Apr 2011
Posts: 75
Malta
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

Joined: Apr 2011
Posts: 75
Malta
I need to switch from fullscreen to window mode so that I can use the file_dialog command however when I try:

video_switch(0,0,2);
char* filename = file_dialog("Load Saved Game","*.ssv");
video_switch(0,0,1);

I get a DirectX driver error. How can I solve this?

Is there a way how to use the file_dialog in fullscreen?
Or how can I switch to window mode and back without this error. I tried using the freeze_mode = 2; before and after freeze_mode = 0; but the error still occured.

Last edited by Ercoles; 05/13/11 15:14.
Re: Error when switching to window mode [Re: Ercoles] #370491
05/13/11 15:26
05/13/11 15:26
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,
Try using wait before or after de video_switch instruction.

Best regards.

Re: Error when switching to window mode [Re: 3dgs_snake] #370494
05/13/11 15:33
05/13/11 15:33
Joined: Apr 2011
Posts: 75
Malta
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

Joined: Apr 2011
Posts: 75
Malta
I tried but problem still there.

Re: Error when switching to window mode [Re: Ercoles] #370627
05/14/11 18:07
05/14/11 18:07
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Youre switching from a window to fullscreen, this works only when your video driver supports that resolution.

Windows support all resolutions when they are not too large, but fullscreen mode is limited to a few resolutions that must be supported by your 3D card and your monitor.

Re: Error when switching to window mode [Re: Tobias] #370636
05/14/11 18:54
05/14/11 18:54
Joined: Apr 2011
Posts: 75
Malta
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

Joined: Apr 2011
Posts: 75
Malta
The problem is not my video card, I can run the game in both fullscreen and windowed and no error occurs, it is only when I switch from fullscreen to windowed or vice-versa that I get the error.

Re: Error when switching to window mode [Re: Ercoles] #370693
05/15/11 02:09
05/15/11 02:09
Joined: Jan 2006
Posts: 245
PA
Garrettwademan Offline
Member
Garrettwademan  Offline
Member

Joined: Jan 2006
Posts: 245
PA
I use window switching a lot in my project and I used to have a lot of issues. Sometimes when I tried to switch modes or resolutions, nothing happened, however I never had a video card throw an exception. If it helps, here is what I use in my current application and it works every time. Let me know if it helps, I guess I am waiting a lot longer than 1 frame, but rather 20 frames.

Code:
if(window_positions[16] == 7){
	video_switch(7,0,2);
	wait(20);
	adjust_chat_window_startup();
	str_cpy(strOptionResolution, "800 X 600");
	}

	if(window_positions[16] == 8){
		video_switch(8,0,1);
		wait(20);
		adjust_chat_window_startup();
		str_cpy(strOptionResolution, "1024 X 768");
	}
	
	if(window_positions[16] == 88){
		video_switch(8,0,2);
		wait(20);
		adjust_chat_window_startup();
		str_cpy(strOptionResolution, "1024 X 768");
	}
	
	if(window_positions[16] == 9){
		video_switch(9,0,1);
		wait(20);
		adjust_chat_window_startup();
		str_cpy(strOptionResolution, "1280 X 1024");
	}
	
	if(window_positions[16] == 10){
		video_switch(10,0,1);
		wait(20);
		adjust_chat_window_startup();
		str_cpy(strOptionResolution, "1400 X 1050");
	}
	
	if(window_positions[16] == 12){
		video_switch(12,0,1);
		wait(20);
		adjust_chat_window_startup();
		str_cpy(strOptionResolution, "1920 X 1080");
	}




Current Project: Computer Repair Simulator
https://www.computer-repair-simulator.com
Re: Error when switching to window mode [Re: Garrettwademan] #370738
05/15/11 12:32
05/15/11 12:32
Joined: Apr 2011
Posts: 75
Malta
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

Joined: Apr 2011
Posts: 75
Malta
This method did not work however you gave me an idea, what I did was to place a

wait(1);

at the beginning of the function and now it works great!

Thanks if it were not for your help I would have never arrived at this solution.

Re: Error when switching to window mode [Re: Ercoles] #370740
05/15/11 12:41
05/15/11 12:41
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
grin But I also told You to try to put a wait before or after the video switch.

Good to know your problem resolved tongue .

Best regards.

Re: Error when switching to window mode [Re: 3dgs_snake] #370742
05/15/11 12:49
05/15/11 12:49
Joined: Apr 2011
Posts: 75
Malta
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

Joined: Apr 2011
Posts: 75
Malta
Yes the problem is to do the wait at the beginning of the function before calling the video_switch command.

Re: Error when switching to window mode [Re: Ercoles] #371120
05/18/11 07:10
05/18/11 07:10
Joined: May 2011
Posts: 2
J
jsmith7 Offline
Guest
jsmith7  Offline
Guest
J

Joined: May 2011
Posts: 2
I'm having the same problem myself. My friend messed with it though and some how it fixed. Up 'til now we still don't know what he did... LOL


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