Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - shruubi

Pages: [1]
1
General / Clear() method overwrites sprite drawing
« on: November 12, 2011, 02:26:58 pm »
see, i knew it was some stupid mistake. thank you for helping me realize my idiocy.  :)

2
General / Trouble with sf::vector2
« on: November 12, 2011, 01:34:20 pm »
i think you're problem is that the vector class uses a template for it's datatype and you are omitting it.

eg:

Code: [Select]

sf::Vector2<int> vector;


where you put the datatype you wish to use in between the <> characters.

3
General / Clear() method overwrites sprite drawing
« on: November 12, 2011, 01:27:53 pm »
So i've just picked up SFML for my first romp into using real graphics for programming (and so far i love it), however i am having a problem with sprite drawing and my Clear() method.

whenever i call the Clear() method all my sprites that work and draw properly without it suddenly stop drawing altogether and stop existing. I have a feeling i am doing something very basic wrong, or i have put code in the wrong place.

Code: [Select]

while(true)
{
app.Clear(sf::Color(0, 255, 255));
app.Display();
app.Draw(player.drawsprite());
float ElapsedTime = app.GetFrameTime();

if(app.GetEvent(Event))
{
if(app.GetInput().IsKeyDown(sf::Key::Up))
{
player.move_up();
}
if(Event.Type == Event::Closed)
{
return EXIT_SUCCESS;
}
if(Event.Type == Event::KeyPressed && Event.Key.Code == Key::Escape)
{
return EXIT_SUCCESS;
}
}
}


any help would be much appreciated.

Pages: [1]
anything