pelya / xserver-xsdl

XSDL - X.Org server ported to Android using SDL.
https://play.google.com/store/apps/details?id=x.org.server
Other
311 stars 55 forks source link

SFML on Termux #158

Open yoshy3904 opened 2 years ago

yoshy3904 commented 2 years ago

I have compiled a sfml application with the sfml package in the x11-repo. It should open a 200x200 px window displaying a green circle.

#include <SFML/Graphics.hpp>

int main()
{
    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();
    }
    return 0;
}

I have problems running the application. I set up an VNC-Server, set DISPLAY=:0, but when trying to run the application ./sfml-app I get the error: Error of failed request: BadMatch(invalid parameter attributes) Major opcode of failed request: 1 (X_CreateWindow) Serial number of failed request: 14 Current serial number in output stream: 16

O5MO commented 2 years ago

I have the exact same issue, even when the code is just

**#include <SFML/Graphics.hpp> int main()

{ sf::RenderWindow window; }** , i get this error: X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 1 (X_CreateWindow) Serial number of failed request: 14 Current serial number in output stream: 16 If i comment out the "sf::RenderWindow window;" it works fine, so the problem is that it cant create a window.