Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / HELP - Switching resolutions in 3d on the fly produces an error!

Author
Message
Draez
23
Years of Service
User Offline
Joined: 1st Nov 2002
Location:
Posted: 17th Jun 2003 00:04
I change the resolution in the beginning of my game by reading it from a reg key and that works fine... however, if i try to switch resolutions after that from within a "menu" then I get...

memory could not be referenced...

doesnt seem to happen alone, for instance if i have just this code in a project:

set display mode 1024,768,32
sync
set display mode 800,600,32

that works fine.. but if i add 3d elements to it... it bombs when changing screen res... at the sync command. anyone run into this and how to get around it? either that or anyone know of a menu example that has 3d elements to it but works?

thanks!

- Draez
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 17th Jun 2003 00:11
Yes, apparently changing modes mid-game can be very dodgy...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 17th Jun 2003 00:24 Edited at: 17th Jun 2003 00:26
Probably why quite a few games I know of only allow switching at the main menu.

Basically, if you switch resolutions, assume that you have to reload everything.

In my case I have a LoadMapAndData() function, if the user switches modes, the DeleteData() and LoadMapAndData() functions are called, and then everything is repositioned / adjusted based on the level state variables.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_103.zip
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 17th Jun 2003 01:05
According to Kangaroo, it can also wipe variables...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Draez
23
Years of Service
User Offline
Joined: 1st Nov 2002
Location:
Posted: 17th Jun 2003 02:47
well now what do i do?

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 17th Jun 2003 11:27 Edited at: 17th Jun 2003 11:28
The best way would be to delete all objects before changing mode (noting any positions if needed), change the mode, re-load the object and re-position if needed.

And hope that none of your variables are affected...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 17th Jun 2003 15:25 Edited at: 17th Jun 2003 15:27
I've had no issues with variables going blank, to me it just seems as if all the stuff on the graphics card RAM is wiped - which given the task of changeing resolutions is totally understandable.

However, as the fastest way for a DBPro app to run in my opinion is Fullscreen Desktop mode, and your application is fastest of all when using the same resolution as the desktop I just set my games to that resolution now.

This code has been rewritten by various people including myself, last author was IanM and it seems to work very well.



Pneumatic Dryll
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 17th Jun 2003 15:54
Never had any variables wiped yet.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_103.zip
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 17th Jun 2003 15:57 Edited at: 17th Jun 2003 16:05
Kangaroo2 does have, if I remember correctly, XP Professional...

Wonder if the problem has been solved now...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Draez
23
Years of Service
User Offline
Joined: 1st Nov 2002
Location:
Posted: 17th Jun 2003 21:18
I've tried deleting the objects and then rebuilding without success although I don't think that I tried deleting the objects then syncing and then rebuilding as all the objects are still visible (albeit frozen) on the screen at the time I go to rebuild.

I'll try that when I get home and post the results here. If anyone else knows of any other way that might get around this problem then please drop a line.

here is the screen of objects i have to delete....


i'll grab a screenshot of what happens later on (with the error) and paste it here.

Thanks for all the suggestions

Morcilla
23
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 25th Jun 2003 16:26 Edited at: 25th Jun 2003 16:28
I actually lose variables content when changing the resolution, that is my main problem with this.
The program never reaches the 'sync' command again (it errors before with the value of some wiped variable), and seems that you cannot restore the variable value, sounds like some kind of memory leak.

This made me lose some time as well, as I thought my program had too many variables or too many call levels, too many files of code or simply too many lines!

I think that the best thing at the moment, if the user changes resolution, is to make the program start over (almost).
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 25th Jun 2003 16:30
So, it sounds like the variable wiping problem hasn't been sorted.
Dont forget to e-mail Lee...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2026-07-16 12:20:07
Your offset time is: 2026-07-16 12:20:07