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 - CrazyNium

Pages: [1]
1
Window / Window creation trouble on SMFL-Pi
« on: September 05, 2018, 04:59:11 am »
I'm using SFML for a project on my Raspberry Pi running Raspbian Stretch (Library gotten from https://github.com/mickelson/sfml-pi), and the window positioning isn't working (the window decoration isn't working, either, but that's a secondary concern). I used this example code from the getting started tutorial:

Quote
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

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

This is supposed to make a typical window with a green circle fitting completely inside the borders. I'm not sure where on the screen it would normally appear, but since the default window position is <0,0>, I would guess that would be the upper left corner of the screen. What I actually see is a green circle in the upper left of the screen but positioned such that the top and left side are off the screen (I estimate that about 15-20% of the expected width/height of the window is cut off). It seems like the window position variables are negative compared to the desktop origin. I've tried setting the window position to something else after creating it, but it doesn't move at all. Also noteworthy is that it lacks any decorations. I've tried running the program before starting the desktop, but the results are the same. Does anyone know what's going on?

One more piece of information is that I'm doing a remote build and run over ssh, but I don't see how that would affect it since the pi is still doing the building and running.

Pages: [1]