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

Author Topic: Why does each sprite set the projection matrix?  (Read 2298 times)

0 Members and 1 Guest are viewing this topic.

jdindia

  • Newbie
  • *
  • Posts: 13
    • View Profile
Why does each sprite set the projection matrix?
« on: November 29, 2008, 05:58:08 am »
I've recently started using SFML in a platform game.  Because I had polygonal textured tiles, I had to do a bit of source browsing to make sure my OpenGL calls wouldn't cause trouble with the generic SFML sprites I was using.

I discovered that the SFML RenderWindow Draw call was setting the projection matrix and then calling the drawable's render function.  This seems a bit strange to me.  I'd expect SetView to change the matrix and then everything else to assume it had been set properly.

Imbue

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Why does each sprite set the projection matrix?
« Reply #1 on: November 29, 2008, 06:11:30 am »
SFML does have a sf::RenderTarget::PreserveOpenGLStates() function you may want to look into.

I'm doing a very small amount of OpenGL and I haven't had any problems yet.