bmx-ng / sdl.mod

SDL backend for BlitzMax
7 stars 6 forks source link

Recreation of an SDL-graphics context not possible #12

Closed GWRon closed 6 years ago

GWRon commented 7 years ago

With OpenGL/DX the following works but with the SDL.mod the result is a black screen instead of a drawn circle and some text.

SuperStrict

Framework sdl.gl2sdlmax2d

SetGraphicsDriver GL2Max2DDriver()
Global _g:TGraphics = Graphics(800, 600, 0)

While Not AppTerminate() And Not KeyDown(key_escape)
    Cls

    If KeyHit(KEY_SPACE) And _g
        Print "reset graphics"
        CloseGraphics(_g)
        _g = Graphics(800, 600, 0)
    EndIf

    DrawText "Text   :", 20, 50
    DrawOval(MouseX()-10, MouseY()-10, 20,20)
    Flip

    Delay 1
Wend

End