1
Graphics / R6025 Error, pure virtual function call
« on: September 02, 2011, 09:22:51 pm »
Hello, I got a problem where when I start my program it crashes with the R6025 error (link : http://support.microsoft.com/kb/125749 )
I managed to find what was causing it but no idea why :
which is in BaseEntity.cpp
Here is the header file :
Here is the object implementing baseentity :
I left out the think method since its only calculating physic related things.
Also I have a world class which just has a basic think and draw loop which is called all of the entity's in the scene (currently only a player entity)
I hope this is detailed enough and if not please tell me what you need. I also know this was causing this since I just removed the
part and it didn't give the error.
I managed to find what was causing it but no idea why :
Code: [Select]
void BaseEntity::Draw(float frameTime)
{
renderWindow->Draw(sprite);
}
which is in BaseEntity.cpp
Here is the header file :
Code: [Select]
#pragma once
#include <SFML\Graphics.hpp>
class BaseEntity
{
protected:
sf::RenderWindow * renderWindow;
public:
sf::Vector2<float> position;
sf::Sprite sprite;
BaseEntity();
BaseEntity(sf::Vector2<float>, sf::Sprite);
virtual void Draw(float);
virtual void Think(float);
};
Here is the object implementing baseentity :
Code: [Select]
#pragma once
#include <SFML\Graphics.hpp>
#include "BaseEntity.h"
class player : public BaseEntity
{
const sf::Input * input;
public:
// Physics variables :
sf::Vector2<float> velocity;
sf::Vector2<float> acceleration;
sf::Vector2<float> friction;
sf::Vector2<float> maxAccelerationSpeed;
player(sf::Vector2<float>, sf::Sprite, const sf::Input*, sf::RenderWindow *);
void Draw(float);
void Think(float);
};
Code: [Select]
#include "player.h"
player::player(sf::Vector2<float> pos, sf::Sprite spr, const sf::Input * inp, sf::RenderWindow * window) : BaseEntity()
{
//Physics :
velocity = sf::Vector2<float>(0,0);
acceleration = sf::Vector2<float>(5,5);
friction = sf::Vector2<float>(0.97f,0.97f);
maxAccelerationSpeed = sf::Vector2<float>(25,25);
position = pos;
sprite = spr;
input = inp;
renderWindow = window;
}
void player::Draw(float frameTime)
{
BaseEntity::Draw(frameTime);
}
I left out the think method since its only calculating physic related things.
Also I have a world class which just has a basic think and draw loop which is called all of the entity's in the scene (currently only a player entity)
I hope this is detailed enough and if not please tell me what you need. I also know this was causing this since I just removed the
Quote
renderWindow->Draw(sprite);
part and it didn't give the error.