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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - PhoenixSuzumiya

Pages: [1]
1
General / Re: Can't inherit sf::Drawable
« on: July 10, 2013, 09:03:47 pm »
*facepalm*
It's the first time I try to inherit classes, I didn't know it needed to be implemented D:
Thank you! xD

2
General / Can't inherit sf::Drawable
« on: July 10, 2013, 06:19:17 pm »
Hi everyone, this is the first time I post on this forum and I need a little help.
I've been messing around with SFML for a month now and I wanted my entities to inherit the draw function from sf::Drawable (as seen on the Vertex Array tutorial page) ò.ò
Here's a minimal example of the class:
Entity.h
#include <SFML/Graphics.hpp>

#ifndef ENTITY_H
#define ENTITY_H

class Entity : public sf::Drawable
{
    public:
    Entity();
    sf::Texture Texture;
    sf::Sprite Sprite;
    virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
};

#endif
 

Entity.cpp
#include "Entity.h"

Entity::Entity()
{
    Texture.loadFromFile("Flashlight.png");
    Sprite.setTexture(Texture);
}
 

The error I get:
undefined reference to `vtable for Entity'
 

My IDE is Code::Blocks and the SFML libreries are dinamically linked.
Thanks for you attention ^^

Pages: [1]
anything