1
Graphics / Sprite won't draw correctly
« on: May 29, 2010, 01:23:30 am »
It works fine.
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.
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML 2D");
sf::Image image;
sf::Sprite sprite;
image.LoadFromFile("tree.tga");
sprite.SetImage(image);
while (App.IsOpened())
{
// Event handling
sf::Event event;
while (App.GetEvent(event))
{
if (event.Type == sf::Event::Closed)
App.Close();
}
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
App.Draw(sprite);
App.Display();
}
return 0;
}