Hi everyone,
I'm using VC++ 2008 with the SFML 2.0 release candidate.
I have just started using the SFML SDK today and I'm slowly familiarizing myself with the smaller components of the graphics library first.
The problem I'm running into is when I try to debug my program (source below) it can't seem to locate local files on my hard drive. When I run the .exe created in the debug directory however, it is able to load the texture file perfectly fine.
Example of debugging:
When I run the compiled exe directly:
And my source code:
#include <vector>
#include <SFML/Graphics.hpp>
const sf::Color kvoid_color(40, 40, 40, 255);
int main() {
sf::RenderWindow window(sf::VideoMode(800, 600), "Profound Seeker");
window.setVerticalSyncEnabled(true);
sf::Texture grass_texture;
grass_texture.loadFromFile("Resources/grass_tile.bmp");
sf::Sprite grass_sprite;
grass_sprite.setTexture(grass_texture);
grass_sprite.setTextureRect(sf::IntRect(0, 0, 40, 40));
grass_sprite.move(100, 100);
//grass_sprite.rotate(23.f);
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed)
window.close();
}; // while window.pollEvent(event)
window.clear(kvoid_color);
window.draw(grass_sprite);
window.display();
}; // while while window.isOpen()
return 0;
}; // int main
Thanks to all who can help!