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

Author Topic: Check whether RenderImage is available doesn't compile  (Read 841 times)

0 Members and 1 Guest are viewing this topic.

thedude

  • Newbie
  • *
  • Posts: 2
    • View Profile
Check whether RenderImage is available doesn't compile
« on: July 30, 2011, 08:59:40 pm »
Hi,

I installed a snapshot of the 2.0 not two weeks ago on my opensuse 11.4. I wanted to follow the good advice in this example of the doc: "make sure that rendering to image is supported". So I used the condition from the example but now g++ won't compile my code, saying: "main.cpp:5:18: error: ‘IsAvailable’ is not a member of ‘sf::RenderImage’". main.cpp is the minimal example I used to check that this line was the only possible source of error:
Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>

int main() {
  std::cout << ((sf::RenderImage::IsAvailable())? "True" : "False") << std::endl;
  return 0;
}


Am I doing something wrong here? I thought it might be a bug either in the example that shouldn't use it (it is not listed as a public method in the doc) or in the code where it should be public.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Check whether RenderImage is available doesn't compile
« Reply #1 on: July 30, 2011, 09:22:09 pm »
Quote
it is not listed as a public method in the doc

The doc is generated from the code. So if it's not in the doc, it's not in the code. Read it carefully, it doesn't mention IsAvailable() anymore.
Laurent Gomila - SFML developer

thedude

  • Newbie
  • *
  • Posts: 2
    • View Profile
Check whether RenderImage is available doesn't compile
« Reply #2 on: July 31, 2011, 12:14:00 am »
That's what I gathered, but then the example needs to be updated.
Quote
Usage example:
Code: [Select]
// First of all: make sure that rendering to image is supported
 if (!sf::RenderImage::IsAvailable())
    return -1;
[...]

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Check whether RenderImage is available doesn't compile
« Reply #3 on: July 31, 2011, 10:04:56 am »
Oh, I really thought I had already removed this line from the example. Thanks.
Laurent Gomila - SFML developer

 

anything