I'm simply doing a test for resolutions changes to add to the options menu in my game. While testing it, I've run into a strange problem. Every time the resolution changes, it seems to forget than there was even an object created.
Here's the code:
sync on
sync rate 60
stop=0
cls
perform checklist for display modes
resmax=checklist quantity()
dim width(checklist quantity())
dim height(checklist quantity())
for c=1 to checklist quantity()
if checklist value c(c)=32
width(c)=checklist value a(c)
height(c)=checklist value b(c)
print "found: "+str$(width)+" x "+str$(height)+" x 32"
else
dec resmax,1
endif
next c
make object cube 1,100
rescurrent=1
rpress=0
press=0
while stop=0
if upkey()=1 and press=0 and rescurrent<resmax
press=1
inc rescurrent,1
endif
if downkey()=1 and press=0 and rescurrent>1
press=2
dec rescurrent,1
endif
if upkey()=0 and press=1 then press=0
if downkey()=0 and press=2 then press=0
text 0,0,"Switch to resolution: ["+str$(width(rescurrent))+"x"+str$(height(rescurrent))+"]"
if returnkey()=1 and rpress=0
rpress=1
set display mode width(rescurrent),height(rescurrent),32
endif
if returnkey()=0 and rpress=1 then rpress=0
position object 1,0,0,0
point camera object position x(1),object position y(1),object position z(1)
position camera 500,500,500
sync
endwhile
My settings in the DBPro EXE setting is
Fullscreen Exclusive Mode (no I don't want to use the widowed mode as it makes everything look like a blurry ugly mess). Is there a way to fix this and/or what am I doing wrong?
Chibi?