The Drawable class has just one function—it has no variables either. Furthermore, its one and only function is purely virtual. This means that if you inherit from Drawable, you must implement its one and only function. This video guides you through resolving this problem.
- [Narrator] Hi, and welcome…to the last video of this section.…Extending SFML classes, particle systems and shaders.…In this section we will start with the SFML Drawable class.…Then we would move onto building a particle system.…And lastly we'll see OpenGl, shaders and GLSL.…Now, we move onto the first video of this section,…that deals with the SFML Drawable class.…In this video, we're going to take a look at…an alternative to inheriting from Drawable.…
And why it is best to inherit from Drawable.…The Drawable class has just one function,…it has no variables either.…Furthermore its one and only function is pure virtual.…This means that if we inherit from Drawable…we must implement its one and only function.…The purpose of this is that we can then use our class.…Which inherits from Drawable, as a polymorphic type.…Put more simply, anything that SFML…allows us to do with a Drawable object…we will be able to do with our class that inherits from it.…
The only requirement is that we must provide…a definition for the pure virtual function, draw.…
This course was created and produced by Packt Publishing. We are honored to host this training in our library.
- Abstract classes
- Level design
- Collision detection
- The HUD class
- Extending SFML classes
- Particle systems