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 1476 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: 11035
    • 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
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything