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.


Topics - moonfirefly

Pages: [1]
1
I use setMouseCursorVisible to hide to mouse cursor when it enters the SFML window. When set to false, the cursor is still visible when it hovers over the running window until it loses focus and gets it back. Only then the cursor remains hidden over the window.

Here's a small program showing this behavior on osx:
(click to show/hide)

I use the latest SFML github source.

Simply moving the mouse cursor over the dock then back over the window kicks in the cursor hide. Command+tab does the same as well.

The same issue can be observed in fullscreen video modes.

2
Window / pollEvent crash after window re-create (osx)
« on: August 23, 2014, 06:52:31 am »
I get a crash on pollEvent after re-creating the window, immediately after I do a command+tab while moving the mouse or trackpad. It looks like input events are polled on a resource that has been deallocated upon re-creating the window.

Here's a small example that triggers the problem every single time on my macbook with these steps:
  • Run example
  • Press 'F' key to trigger a window re-create
  • Press command+tab to lose window focus while moving mouse/trackpad
Example source:
(click to show/hide)

The exception as it occurs in Xcode:
(click to show/hide)

The crash log with a test outside Xcode:
(click to show/hide)

The issue occurs even if the resolution is not changed or using different styles. I compiled SFML from source as of today. I did try to re-create the window outside the pollEvent loop but still get the crash at the next pollEvent call.

Note that doing plenty of command+tab and mouse events without window re-creation does not trigger the problem.

Am I doing something wrong here?

3
Graphics / Visible border around fullscreen window (retina)
« on: August 13, 2014, 03:04:14 am »
I am testing high dpi resolution on a macbook pro retina. Windowed mode works great but I noticed that resolutions lower than desktop show up with a border in fullscreen. The window pixel size is accurate but does not scale to cover the full screen.

The following valid resolutions are affected:
  • 2560 x 1600
  • 1680 x 1050
  • 1440 x 900
  • 1280 x 800
Here's a small complete program to reproduce the problem provided you can test on a macbook pro retina. You will see a white rectangle that matches windows size yet does not take the whole screen.

#include <SFML/Graphics.hpp>

int main(int, char const**)
{
    sf::RenderWindow window(sf::VideoMode(1680, 1050), "SFML window", sf::Style::Fullscreen);
   
    sf::RectangleShape shape;
    shape.setSize(sf::Vector2f(1680, 1050));
   
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::KeyPressed) {
                window.close();
            }
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return EXIT_SUCCESS;
}
 

I have compiled SFML from the latest github code and testing on osx 10.9.4. The display settings are set to default "best for display".

Is this intended behavior? is it possible to make the lower resolution scale to fullscreen? of course the fullscreen window size is fine at the native 2880x1800 but it does take hit on performance.

4
SFML projects / Blokade [source and binaries now available]
« on: January 21, 2013, 03:57:00 am »
I got far enough to show my work in progress with my simple game Blokade, a falling blocks clone. My goal is to experiment with SFML and learn to make a small game in C++ in XCode.



Right now I'm not able to get the game to run on anything besides the Mac I used to make it. I think the XCode build settings need to be tweaked. I will make a binary available when I sort this out :)

---

Just uploaded Blokade version 0.9.3 with top 5 high scores and top lines. A lot of changes in code but UI is the same.

Github: https://github.com/moonfirefly/Blokade
OSX binary: https://www.dropbox.com/s/ig2cu3qv5usksd7/Blokade_0.9.3_OSX_En.zip
Windows binary: https://www.dropbox.com/s/edy9gpticrk9orj/Blokade_0.9.3_Windows_En.zip

This is probably my last update for this game for a while. I'm starting my next SFML project, a mario bros 1 platformer :) I will upload to github and make binaries available as soon as I get a decent version running.

5
System / isKeyPressed does not always capture input
« on: January 19, 2013, 06:22:04 pm »
I have the following code to check for return key press in my menu main loop :

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Return)) {
    if (m_buttonExit.isSelected()) {
        m_pWindow->close();
    }
    else if (m_buttonStart.isSelected()) {
        newGame();
    }
}

The problem is that sometimes I have to press twice to actually get it to detect the return key press. I don't press any other key at the same time and this code executes at every single loop. I'm on OS X.

I'm not sure what to do at this point. I disabled to key repeat, no difference. The problem is intermittent as well, happens roughly 1 out of 5 times.

Pages: [1]