... is the error message I get after I run my program. I've checked the paths, they are ok, copied the images from their folder into the root of the program, even changed them from JPG to PNG and nothing... same error message for each image that is being loaded. It worked before in an other program, which was not much different from this one in terms of classes and such.
Here is the code:
main.cpp:
#include <iostream>
#include "kareninacharacter.h"
#include "blocks.h"
#include "mappings.h"
#define NAME "To heaven with you"
using namespace std;
int main() {
sf::RenderWindow *pApplication = new sf::RenderWindow(sf::VideoMode::GetMode(0), NAME, sf::Style::Fullscreen);
Blocks *pBackground = new Blocks(PLACEHOLDER);
kareninaCharacter *pPlayableCharacter = new kareninaCharacter(PLAYABLE_CHARACTER);
sf::Shape Floor = sf::Shape::Rectangle(0, 4800, 5000, 5000, sf::Color(50, 50, 50, 0)); //replace with Blocks
bool running = pApplication->IsOpened();
while(running)
{
sf::Event Event;
while(pApplication->GetEvent(Event))
{
if((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
{
pApplication->Close();
}
}
pApplication->Clear();
pApplication->Draw(pBackground->getSprite());
pApplication->Draw(Floor);
pApplication->Draw(pPlayableCharacter->getSprite());
pApplication->Display();
}
return 0;
}
mappings.h:
#ifndef MAPPINGS_H_
#define MAPPINGS_H_
#define PLACEHOLDER "placeholder.png"
#define PLAYABLE_CHARACTER "pc.png"
#endif
Also, the Blocks and kareninaCharacter class are pretty much the same, except the latter one has a few more methods, but the process of loading images and sprites is the same and as in the tutorial:
Blocks(string imglocation)
{
this->imgLocation = imgLocation;
Image.LoadFromFile(imgLocation);
Sprite.SetImage(Image);
}
I am using Visual Studio 2010 on Win7 x64