Switching back from canvas to GraphicsMode?

BlitzMax Forums/BlitzMax Programming/Switching back from canvas to GraphicsMode?

Hey, I'm having an app that is using a DirectX GraphicMode and a Window with a canvas.

Now I use SetGraphics(CanvasGraphics(MyCanvas)) to draw things to my window, but how can I jump back to the DirectX-GraphicMode? Is there a global graphic object I can use with SetGraphics, somethig like SetGraphics(MyGraphicObject)???

I tried to set a handle to it, but the following code doesn't work:

Global MyGraphics:TGraphics = Graphics(640,480,0,60)

What happens when it doesn't work?
This seems OK
SuperStrict
Local g:tgraphics = Graphics(800 , 600)
SetGraphics g
Local MyWindow:TGadget=CreateWindow("Canvas Example", 200,200,320,240)
Local MyCanvas:TGadget=CreateCanvas(10,10,290,140,MyWindow)

Repeat
  WaitEvent()
  Select EventID()
  Case EVENT_WINDOWCLOSE
     End
  Case EVENT_GADGETPAINT
    SetGraphics CanvasGraphics (MyCanvas)
	 DrawRect 20 , 20 , 50 , 80
	SetGraphics G
	DrawOval 100,100,100,100
    Flip
   End Select
Forever


okay, wenn I use the Graphics-Command with brakets it does work. Thanks!