Strange Graphics Error

Blitz3D Forums/Blitz3D Programming/Strange Graphics Error

Mr.Bob94(Posted 2005) [#1]
Hi everyone,
When I try to create an exe file, or run my program without debug enabled, I get an error saying "Unable to set Graphics Mode". Why is this, and what can I do to fix it?
Thanks for helping.


big10p(Posted 2005) [#2]
You can get this error ocassionally, usually when you have another graphics app running. If closing the other apps doesn't fix it, reboot and it should be OK.


Mr.Bob94(Posted 2005) [#3]
Hmm... rebooting didn't work. Anything else that might?


big10p(Posted 2005) [#4]
Are you setting a 2D or 3D graphics mode? Infact, can we see some code?


Mr.Bob94(Posted 2005) [#5]
ok... it's a very simple program.
AppTitle "Romules and Remus"
music = PlayMusic ("Eagleland__Onett.mid")
Graphics 611,349
SetBuffer BackBuffer ()
.start
intro = LoadImage ("tiberintro.bmp")
DrawImage intro, 0,0
Flip
begin$ = Input ("")
If begin$ = "" Then Goto slide1
.slide1
StopChannel music
music2 = PlayMusic ("sadness.mid")
Cls
Graphics 827,682
slde1 = LoadImage ("tiberbank.bmp")
DrawImage slde1, 0,0
Flip
WaitKey
Goto slide2
.slide2
StopChannel music2
music4 = PlayMusic ("notlike.mid")
Cls
Graphics 518,456
disagree = LoadImage ("disagree.bmp")
DrawImage disagree, 0,0
Flip
WaitKey
Goto slide3
.slide3
StopChannel music2
music3 = PlayMusic ("linktheme.mid")
Cls
Graphics 708,419
mount = LoadImage ("decide.bmp")
DrawImage mount, 0,0
Flip
WaitKey
Goto slide4
.slide4
StopChannel music3
music4 = PlayMusic ("fighting.mid")
Cls
Graphics 773,576
fight = LoadImage ("twinfight.bmp")
DrawImage fight, 0,0
Flip
WaitKey
Goto endshow
.endshow
StopChannel music4
endmusic = PlayMusic ("endmusic.mid.")
Cls
Graphics 522,403
endimg = LoadImage ("ending.bmp")
DrawImage endimg, 0,0
Flip
WaitKey
End


big10p(Posted 2005) [#6]
OK, that ran in debug because running in debug uses a window that can be set to strange sizes like 522x403, however, without debug on that will run in fullscreen and modes like 522x403 aren't supported!

You need to set a flag in the Graphics command to specify windowed mode (see docs).


jhocking(Posted 2005) [#7]
Yeah, always specify the windowed mode explicitly, something like
Graphics 640,480,32,2

I always thought it was odd that it varies between fullscreen/windowed based on whether or not you are debugging, but if you set the flag explicitly then it won't matter.

You need to set a flag in the Graphics command to specify windowed mode (see docs).

That or use standard resolutions. Like 640x480, 800x600, 1024x768, etc.


Mr.Bob94(Posted 2005) [#8]
Thanks everyone! This should solve my problem...


Matty(Posted 2005) [#9]
Any reason why you need to alter the screen resolution for each image?


jhocking(Posted 2005) [#10]
Oh yeah, I didn't even think of that. wtf?


big10p(Posted 2005) [#11]
Any reason why you need to alter the screen resolution for each image?
I figured he just wants to do a slide show where each image is nicely framed in a window. It's a bit unorthodox but there's no real reason not to do it this way.


RGR(Posted 2005) [#12]
It's a bit unorthodox but there's no real reason not to do it this way.

As long as you do not try it in fullscreen mode.


big10p(Posted 2005) [#13]
As long as you do not try it in fullscreen mode.
We've already established that. ;)


Baystep Productions(Posted 2005) [#14]
Umm to add in, I believe there is a command of GFXModeExist or sumtin to check to see if the system supports it. And I usualy set all my parameters when calling graphics. IE.
"Graphics3D 1024,768,32,1"


RGR(Posted 2005) [#15]
@big10p
We've already established that. ;)

And why did you write this nonsense then? ;-)
It's a bit unorthodox but there's no real reason not to do it this way.

There is one ... it doesn't work in Fullscreen mode as I say again
and it makes no sense in Windowed mode because in this case the pictures are not fullscreen...
So what ? :-P


Ross C(Posted 2005) [#16]
to quote big10p...

OK, that ran in debug because running in debug uses a window that can be set to strange sizes like 522x403, however, without debug on that will run in fullscreen and modes like 522x403 aren't supported!




big10p(Posted 2005) [#17]
RaGR: I suggest you read through the whole thread again - you seem to have missed the point. To sum up: he wants to use windowed mode, not fullscreen - that's why he's changing modes for each image.

As Ross C points out, I've already said it won't work in fullscreen mode. ;)