SFML community forums
Help => Graphics => Topic started by: Poraft on September 15, 2012, 03:03:55 am
-
I used some older version of SFML2, where I used RenderWindow->ConvertCoords();
But in the rc I can't use that anymore, I can't find out how to use RenderTarget I can't even declare it.
Gives the error:
G:\CBprojects\PazookaCB\ingame.h|29|error: cannot declare field 'InGame::RT' to be of abstract type 'sf::RenderTarget'|
G:\SFML-2.0-rc\include\SFML\Graphics\RenderTarget.hpp|52|note: because the following virtual functions are pure within 'sf::RenderTarget':|
G:\SFML-2.0-rc\include\SFML\Graphics\RenderTarget.hpp|206|note: virtual sf::Vector2u sf::RenderTarget::getSize() const|
G:\SFML-2.0-rc\include\SFML\Graphics\RenderTarget.hpp|345|note: virtual bool sf::RenderTarget::activate(bool)|
||=== Build finished: 1 errors, 0 warnings ===|
Please provide me an example.
-
hmmm, maybe try reading the documentation (http://sfml-dev.org/documentation/2.0/classsf_1_1RenderTarget.php)?
....Quite a bit back the naming convention was changed to camelCase so reading always helps. Also read the error, "error: cannot declare field 'InGame::RT' to be of abstract type" means quite a bit. Try googling abstract, because abstract classes cannot have objects created from them.
-
And you probably want a sf::RenderWindow, not sf::RenderTarget which is its abstract base class.
-
Thanks, I solved it.