Error during execution on ubuntu vm
J-Siu opened this issue · comments
I am able to compile in a Ubuntu 20.10 VM. However it gives following error:
% ./NoCol
Couldn't find 'conf.txt', loading default
The requested video mode is not available, switching to a valid mode
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 1 (X_CreateWindow)
Serial number of failed request: 159
Current serial number in output stream: 160
You can try to create a conf.txt
file with values in this order:
win_width
win_height
objects_count
min_size
max_size
next to the executable.
It seems the default window size is too large so the conf file should allow you to choose a good resolution.
It is not config issue. I added a few log lines and it stopped at sf::RenderWindow window(sf::VideoMode(conf.win_width, conf.win_height), "NoCol", sf::Style::Fullscreen, settings);
. I tried 100x100, 1024x768 etc, smae result.
Tested with https://www.sfml-dev.org/tutorials/2.5/start-linux.php and get the same result:
% ./sfml-app
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 1 (X_CreateWindow)
Serial number of failed request: 152
Current serial number in output stream: 153
Maybe because it is a VM or because Ubuntu 20.10 is using wayland, not sure. However basic glx test like glxheads
, glxgears
work.
Are you able to compile and run this SFML hello world ?
#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;
}
Are you able to compile and run this SFML hello world ?
Yes, that is the one I tried and getting error also.
So it seems it's an SFML error, that's annoying :/
So it seems it's an SFML error, that's annoying :/
Yeah, my guess is sfml + wayland + ubuntu. As I don't have a bare metal to test, can't rule out vm, but I doubt it as glxgears works.
I am closing this as this is a sfml issue.
Thank you!!