Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ThatSomeMess

Pages: [1]
1
Window / Possible bug with IsMouseButtonDown(sf::Mouse::Left)
« on: March 11, 2012, 12:03:49 am »
Hi,

I've written a small test program which collects events and draws to the screen only when the left mouse button is down.

The problem occurs with the following sequence of events:

I hold down the left mouse button to start drawing.
I move the mouse cursor outside of the window area.
I release the button.
I move the cursor back into the window area.

Now the screen is still being drawn to even though the mouse button is no longer down.

Code:

Code: [Select]
       if (input.IsMouseButtonDown(sf::Mouse::Left))
        {
            // register action for undo, and save prompt

            while (input.IsMouseButtonDown(sf::Mouse::Left))
            {
                eInst.editActionDraw();

                /* get and discard events */

                win->Clear();
                drawTiles();
                drawUI();
                win->Display();
            }
        }

Pages: [1]
anything