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

Author Topic: Clear() doesnt clear Depth Buffer  (Read 1901 times)

0 Members and 1 Guest are viewing this topic.

Boogiwoogie

  • Newbie
  • *
  • Posts: 19
    • View Profile
Clear() doesnt clear Depth Buffer
« on: February 09, 2010, 04:04:09 pm »
Hi,
I was just about to do some SFML/pure OpenGL mixing. Found out that RenderWindow->Clear() does not clear the depth buffer. Not surprising, because a depth buffer is not in use ;)
However, if I create my RenderWindow using the ContextSettings, and I set DepthBits to some reasonable value, I would expect Clear() to clear it, too.
No big deal, though.
boogi

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Clear() doesnt clear Depth Buffer
« Reply #1 on: February 09, 2010, 04:38:39 pm »
Quote
However, if I create my RenderWindow using the ContextSettings, and I set DepthBits to some reasonable value, I would expect Clear() to clear it, too.

That wouldn't be a good idea. You control what's written in the depth-buffer, you control its activation/deactivation, you control the clear value, so... you control the moment you want to clear it too.
SFML, on the other hand, doesn't even know what a depth-buffer is (except in ContextSettings, which makes sense only for external OpenGL code anyway).
Laurent Gomila - SFML developer