changing graphics modes

BlitzMax Forums/BlitzMax Beginners Area/changing graphics modes

Oh wait, after reading it properly...Not what he said.

The first code sample works perfectly if you set the gl driver first. So probably a bug with the DX7 implementation.
SetGraphicsDriver GLMax2DDriver()

Graphics 800,600,16,0

While Not KeyHit(KEY_ESCAPE)

	SetColor 255,255,255
	DrawText "Select graphics mode:",20,20
	DrawText "--------------------",20,40
	DrawText "1) Fullscreen mode",20,60
	DrawText "2) Windowed mode",20,80
	
	' change to fullscreen mode
	If KeyHit(KEY_1)
		EndGraphics
		FlushMem
		Graphics 800,600,16,0
	EndIf
	
	' change to windowed mode
	If KeyHit(KEY_2)
		EndGraphics
		FlushMem
		Graphics 800,600,0,0
	EndIf

	Flip
	FlushMem
	Cls
Wend
End