SFML community forums

General => SFML website => Topic started by: azoundria on January 03, 2014, 11:28:06 pm

Title: Think This Is A Typo
Post by: azoundria on January 03, 2014, 11:28:06 pm
On this page:
http://www.sfml-dev.org/tutorials/2.0/graphics-draw.php

You have this text in the Off-screen drawing section:
sf::Texture& texture = renderTexture.getTexture();

// draw it to the window
sf::Sprite sprite(texture);

I think the ampersand is a typo.
Title: Re: Think This Is A Typo
Post by: FRex on January 03, 2014, 11:35:39 pm
It's not.
Title: Re: Think This Is A Typo
Post by: Daddi on January 04, 2014, 01:03:44 am
To be a bit more specific: the & says, that "texture" is a reference, not an actual object :)
Title: Re: Think This Is A Typo
Post by: Nexus on January 04, 2014, 09:41:38 am
However, sf::RenderTexture::getTexture() returns a const sf::Texture&, therefore it should be a const reference.