SFML community forums

Help => Graphics => Topic started by: thedude on July 30, 2011, 08:59:40 pm

Title: Check whether RenderImage is available doesn't compile
Post by: thedude 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 (http://www.sfml-dev.org/documentation/2.0/classsf_1_1RenderImage.php#details) 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.
Title: Check whether RenderImage is available doesn't compile
Post by: Laurent 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.
Title: Check whether RenderImage is available doesn't compile
Post by: thedude 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;
[...]
Title: Check whether RenderImage is available doesn't compile
Post by: Laurent on July 31, 2011, 10:04:56 am
Oh, I really thought I had already removed this line from the example. Thanks.