SFML community forums
Help => Window => Topic started by: on January 20, 2011, 07:14:28 am
-
Hello,
I am new to SFML. Here is part of my code:
// Load and apply Icon
sf::Image icon;
if (!image.LoadFromFile("opendarkcore.png"))
return EXIT_FAILURE;
window.sf::Window::SetIcon(icon.GetWidth(), icon.GetHeight(), icon.GetPixelsPtr());
// END of setting Icon
This is what I get:
Trying to access the pixels of an empty image
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 53 (X_CreatePixmap)
Value in failed request: 0x0
Serial number of failed request: 55
Current serial number in output stream: 61
What do I do wrong? :(
-
Your image is empty. Are you sure that it succeeds to load?
-
But shouldn't it report then EXIT_FAILURE?
-
My whole source is located at:
http://gitorious.org/opendarkcore/master
the file with a problem is main.cpp line 31... I think
-
Oh, so that was not a typo in your post ;)
sf::Image icon;
if (!image.LoadFromFile("opendarkcore.png"))
return EXIT_FAILURE;
-
Now it works :) such a stupid mistake I did...