bmx-ng / sdl.mod

SDL backend for BlitzMax
7 stars 6 forks source link

HideMouse wont work if BRL.GLMax2D is imported too #10

Closed GWRon closed 6 years ago

GWRon commented 8 years ago

The following code does not hide the mouse cursor - until you comment out Import brl.GLMax2D

SuperStrict

'keep it small
Framework BRL.standardIO
Import brl.Graphics
Import sdl.gl2sdlmax2d
Import brl.GLMax2D

SetGraphicsDriver GL2Max2DDriver()
Graphics(800, 600, 0, 0, 0)
HideMouse()

Repeat
    Cls
    DrawOval(MouseX()-2, MouseY()-2, 4,4)           
    Flip
Until AppTerminate() Or KeyHit(KEY_ESCAPE)

Switching order of both import statements makes HideCursor work too

woollybah commented 8 years ago

I'm surprised anything works at all if you import GLMax2D...

For a start, you are mixing together two event systems - which is never going to end well...

GWRon commented 8 years ago

I know that this should not be done ... but it is possible, and therefor it should either blame it (throw something to the coder) or come along with what the human being wants to "do" (without knowing the details).

GWRon commented 8 years ago

Why am I requesting a "throw to the user"?

On Windows you Import the DX modules and the OGL one ... so the enduser might choose from possible render engines. I assumed that throwing in GL2SDL is similar and never thought it does not "automatically handle" things like replacing the brl-eventsystem (systemdefault) with the SDL one - if the sdl driver is used.

woollybah commented 6 years ago

Should be fixed in the latest version.