Graphics bug?

Started by GW, May 18, 2021, 21:57:45

Previous topic - Next topic

GW

When the mouse is held down, MouseX() and MouseY() are reading outside the window.  Both GL and DX.

SuperStrict
Framework brl.basic
Import brl.glmax2d

Const GW:Float = 800
Const GH:Float = 800

Graphics GW,GH

While Not KeyHit(key_escape)
    Cls
        DrawText(Float(MouseX())/GW+ " " + Float(MouseY())/GH,400,400 )
    Flip
Wend

Henri

Hi GW,

I dont think this is a bug. This behavior is found in the original Blitzmax as well.

It might be related to SetCapture Windows API function where developer is able to receive mouse coordinates outside client area. When mouse button is pressed in clientarea, SetCapture is called to enable features like drag&drop an similar where tracking needs to extend beyond client area.

Anyways, this is my guess. https://docs.microsoft.com/en-us/windows/win32/learnwin32/mouse-movement

-Henri

- Got 01100011 problems, but the bit ain't 00000001

Midimaster

Isn't this the same behavoir windows always shows, when f.e. you move a scrollbar and accidentally leave the window? In this cases the users wishs to continue the scrolling. So I think it is a windows feature...
...back from Egypt

GW

I've never noticed it after all these years.  Thanks