hello every one
I am now in chapter three in SFML Game Development
class SceneNode : public sf::Transformable, public sf::Drawable,
private sf::NonCopyable
{
public:
typedef std::unique_ptr<SceneNode> Ptr;
public:
SceneNode();
void attachChild(Ptr child);
Ptr detachChild(const SceneNode& node);
private:
virtual void draw(sf::RenderTarget& target,
sf::RenderStates states) const;
virtual void drawCurrent(sf::RenderTarget& target,
sf::RenderStates states) const;
private:
std::vector<Ptr> mChildren;
SceneNode* mParent;
};
The draw() function allows our class to be used as shown in the following
code snippet:
sf::RenderWindow window(...);
SceneNode::Ptr node(...);
window.draw(*node); // note: no node->draw(window) here!
The window class internally calls our draw() function. No other classes need access
to it, so we can make it private.
I realy can,t understand what (internally calls our draw()function mean)