changing graphics modes

BlitzMax Forums/BlitzMax Beginners Area/changing graphics modes

it would appear to be a problem with the graphics command in some manner yes.

SetGraphicsDriver(GLMax2DDriver())
Graphics 800,600,0,0

Global usingBGL = False

While Not KeyHit(KEY_ESCAPE)

	SetColor 255,255,255
	
	If usingBGL Then
		bglDrawText "Select graphics mode:",20,20
		bglDrawText "--------------------",20,40
		bglDrawText "1) Fullscreen mode",20,60
		bglDrawText "2) Windowed mode",20,80
		
	Else
		
		DrawText "Select graphics mode:",20,20
		DrawText "--------------------",20,40
		DrawText "1) Fullscreen mode",20,60
		DrawText "2) Windowed mode",20,80

	EndIf

	
	' change to fullscreen mode
	If KeyHit(KEY_1)
		EndGraphics
		FlushMem
		
		usingBGL =True
		'Graphics 800,600,32,0
		bglCreateContext(800,600,16,0, BGL_FULLSCREEN|BGL_BACKBUFFER)
		
	EndIf
	
	' change to windowed mode
	If KeyHit(KEY_2)
		'EndGraphics
		bglSwapBuffers()
		bglDeleteContext
		FlushMem
		usingBGL = False
		Graphics 800,600,0,0
	EndIf


	If usingBGL then
		bglSwapBuffers()
		FlushMem
	Else
		Flip
		FlushMem
		Cls
	EndIf
Wend
End



I was messing around with it and you can create a fullscreen GL context and switch back to window mode without issue (it does stop rendering the text when you switch to fullscreen for the second time, but that's *probably* a seperate issue).
There is no exception produced using the above.