Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to use RenderTarget?  (Read 2098 times)

0 Members and 1 Guest are viewing this topic.

Poraft

  • Newbie
  • *
  • Posts: 24
    • View Profile
How to use RenderTarget?
« 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:
Quote
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.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: How to use RenderTarget?
« Reply #1 on: September 15, 2012, 03:21:49 am »
hmmm, maybe try reading the documentation?




....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.
« Last Edit: September 15, 2012, 03:26:03 am by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to use RenderTarget?
« Reply #2 on: September 15, 2012, 09:19:31 am »
And you probably want a sf::RenderWindow, not sf::RenderTarget which is its abstract base class.
Laurent Gomila - SFML developer

Poraft

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: How to use RenderTarget?
« Reply #3 on: September 15, 2012, 10:31:26 am »
Thanks, I solved it.