SetGraphics problem

BlitzMax Forums/BlitzMax Programming/SetGraphics problem

Robert Cummings(Posted 2006) [#1]
Hi there,

I am using SetGraphics CanvasGraphics(canvas) to direct bmax drawing to a canvas in a window. However my editor has a full-screen mode for testing too.

I perform the following when I want to do this:

Local g:TGraphics = Graphics(app.gameWidth , app.gameHeight , 32 , 0)
SetGraphics g

However I am greeted with a black full-screen. Why is this? I had thought I could use SetGraphics to direct the drawing output?


Robert Cummings(Posted 2006) [#2]
Is making a normal graphics mode and redirecting output from your editor illegal then? cos I do this to test my game "as it should be".


Robert Cummings(Posted 2006) [#3]
Nope, no joy - I don't know how to make a windowed mode app with a canvas then switch to a full screen app, redirecting the drawing.

Any help?


ImaginaryHuman(Posted 2006) [#4]
If you call Graphics() you do not need to call SetGraphics after it, the display is already open and working.

What you might consider is changing Graphics() to CreateGraphics() and then calling SetGraphics(), unless you want the flip/timing feature of Graphics()

Does your graphics card support the resolution and color depth you are requesting, ie gamewidth x gameheight in 32 bit?

Does your system regularly support full-screen 32-bit when you just do Graphics 640,480,32?

Did you draw to the screen but forget to flip it?


Grey Alien(Posted 2006) [#5]
I concur with AngelDaniel here. CreateGraphics then SetGraphics or just Graphics() or it's own. However your problem sounds like it might be something else, weird.


TomToad(Posted 2006) [#6]
I seem to have the same problem. Could someone post an example windowed/full-screen switching demo?


Robert Cummings(Posted 2006) [#7]
This is a bug, an incompatiblity between maxgui and max. I have posted a thread on it here:

http://www.blitzmax.com/Community/posts.php?topic=59170

Grey and angeldaniel have between them worked out it works fine under opengl but not DX...