I appear to have run into an error within SFML 2.0. From the example given in the documentation, I cannot create an image based on the code given.
Here is my main.cpp.
#include <SFML/Graphics.hpp>
#define spritewidth 32
#define spriteheight 32
int main()
{
sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "SFML woo");
sf::Image spritesheet;
if (!spritesheet.loadFromFile("spritesheet.png"))
return -1;
sf::Image image;
if (!image.create(20, 20, sf::Color(0, 0, 0, 255)))
return -1;
while (Window.isOpen())
{
sf::Event Event;
while (Window.pollEvent(Event))
{
switch (Event.type)
{
case sf::Event::Closed:
Window.close();
break;
default:
break;
}
}
Window.clear(sf::Color(255, 255, 255));
Window.display();
}
return 0;
}
Compiling with the GNU/GCC/MinGW compiler base, running sfml 2.0 rc.
Here is my compiler error.
In function 'int main()':
error: could not convert 'image.sf::Image::create(20u, 20u, (*(const sf::Color*)(& sf::Color(0, 0, 0, 255))))' from 'void' to 'bool'
error: in argument to unary !
=== Build finished: 2 errors, 0 warnings ===
Searching led me nowhere, I only seemed to run into dead-ends, as apparently no-one has suffered the same problem I have!
Thank you!