Changing GFX Resolution

Blitz3D Forums/Blitz3D Programming/Changing GFX Resolution

Ok I got it setup so when I click the apply button the resolution will change if needed. But when I do I get a memory access violation. Im using BUI gui and it returns display$ from the combo box.

if display$ = "800x600"
width = 800
height = 600
endgraphics
Graphics3d width, height, 0, 1
endif
if display$ = "1024x768"
width = 1024
height = 768
Graphics3d width, height, 0, 1
endif

You will need to reload all your graphics after a screen resolution change.

Ok what all do I have to reload. cameras? Lights? objects? GUI? ect...

yes

Ok what all do I have to reload. cameras? Lights? objects? GUI? ect
Everything - cameras, lights, textures, meshes, pivots, terrains, the lot. The only thing you don't need to reload are variable contents (arrays and so on), and sounds.

wow lol maybe Ill just have them restart after they apply. That all seems sorta a pain in the arse. I would have to capture all the info and save it to restore it after I changed the display but if they restart its all done for them and they save before hand.

You could do this

global GotoOrNot = 0
.setup
(setup your cams and meshes and stuff)
if GotoOrNot = 1
Goto .returnpoint
endif
GotoOrNot = 1
(other stuff (if you have it) goes here)
if display$ = "800x600" 
width = 800 
height = 600 
endgraphics 
Graphics3d width, height, 0, 1 
goto .setup
endif 
if display$ = "1024x768" 
width = 1024 
height = 768 
Graphics3d width, height, 0, 1 
goto .setup
endif 
.returnpoint

Basically it sets a label before the setup area and after the point that you goto the setup area. Once at the setup area, after it gets through with doing its stuff. It finds out if it needs to goto the return point or not. I hope i am not to vauge.

I'm not sure of what your doing, so if you need to tweek around with stuff, I'm sorry.