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

Author Topic: Is it possible to create class which inheritance sf::Drawable and which can be..  (Read 769 times)

0 Members and 1 Guest are viewing this topic.

Putarda

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Is it possible to create class which inheritance sf::Drawable and which sf::Drawable can be overwritten by an sfml Drawable class for example sf::CircleShape?

If so, would it look like this?
sf::RectangleShape s;

sf::Drawable* f = &s;

Object* d = &f; //My class which inhertiance sf::Drawable

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10224
    • View Profile
    • development blog
    • Email
Am I understanding you right, that you basically want a base class to sf::Drawable? You can't achieve that by inheriting from sf::Drawable.
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/