SFML community forums

Help => Window => Topic started by: grejak on December 28, 2015, 09:01:20 pm

Title: Error executing very simple SFML Code
Post by: grejak on December 28, 2015, 09:01:20 pm
Hey :)

I recently bought a Raspberry Pi 2B and downloaded and succesfully compiled SFML  on it.
I can compile this little program using:

g++ sfml.cpp -o sfml -lsfml-system -lsfml-window -lsfml-graphics

#include <iostream>
#include "SFML/Graphics.hpp"

int main()
{
  sf::Window window(sf::VideoMode(800,600),"Title");
  return 0;
}
 

But when I try to execute it I get the following Error Message:

Failed to get visual info
Failed to create window
X Error of failed request: BadWindow (invalid Window.parameter)
 Major opcode of failed request : 3 (X_GetWindowAttributes)
Title: Re: Error executing very simple SFML Code
Post by: DarkRoku12 on December 28, 2015, 10:53:25 pm
Raspsberry pi uses openGL ES, and sfml support it.
But probably SFML dosen't have the work arrounds and the #defines for handling raspberry pi system and graphics.
Title: Re: Error executing very simple SFML Code
Post by: grejak on December 28, 2015, 11:39:13 pm
Problem was that the Standard Bits per Pixel (=32) was not a valid argument .
So after changing it into 16 in the Constructor it worked just fine :)