2 registered members (TedMar, AndrewAMD),
1,344
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Error when switching to window mode
#370487
05/13/11 15:06
05/13/11 15:06
|
Joined: Apr 2011
Posts: 75 Malta
Ercoles
OP
Junior Member
|
OP
Junior Member
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]
#370693
05/15/11 02:09
05/15/11 02:09
|
Joined: Jan 2006
Posts: 245 PA
Garrettwademan
Member
|
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.
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");
}
|
|
|
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
Senior Member
|
Senior Member
Joined: Feb 2010
Posts: 320
TANA/Madagascar
|
But I also told You to try to put a wait before or after the video switch. Good to know your problem resolved . Best regards.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|