Hey guys, I recently switched from CodeBlocks and MinGW to Visual C++ Express 2008. But I've been running into some problems with the current code I have.
1. Where do I put the SFML_DYNAMIC macro? The image in the tutorial doesn't show so I don't know where to put it.
2. Right now I'm linking against the static libs so I can get some work done, till I fix issue #1 but when I try to load an image, it says can't be found. I've manually checked to see if that image is there but the program can't find it.
Here is my code so you can see how I'm doing my image loading.
#include <iostream>
#include <SFML/Graphics.hpp>
int main()
{
//Create the window of the application
sf::RenderWindow App(sf::VideoMode(1024, 728, 32), "GunKnights");
//Set the frame rate
App.SetFramerateLimit(60);
//Ground Image
sf::Image groundImage;
//Load the ground image
if (!groundImage.LoadFromFile("gfx\\maps.png"))
{
std::cout << "Error loading maps.png" << std::endl;
return EXIT_FAILURE;
}
//Create a ground sprite
sf::Sprite ground(groundImage);
//Set the position of the ground image
//ground.SetPosition(0, App.GetHeight() - ground.GetSize().y);
bool IsPlaying = true;
while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
//Window closed or escape key pressed : exit
if ((Event.Type == sf::Event::Closed) ||
((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape)))
{
App.Close();
break;
}
}
if (IsPlaying)
{
}
//Clear the Window
App.Clear(sf::Color(100, 149, 237, 100));
//Draw the ground image
App.Draw(ground);
App.Display();
}
return EXIT_SUCCESS;
}
If anyone can help me fix the following problems, I would really appreciate it!
Thanks,
YellowShadow