Hey all,
I'm using sfml along with box2d for a project I'm working on. I implemented box2d's DebugDraw class and try to use it but there's some weird caveat to it I'm not sure about. If I don't call sfml's Draw() method (eg the third line, _window->Draw()), nothing at all draws. I don't see the debug data drawn and I don't understand why. However, when I have that line there, the circle shape draws fine, along with the debug data on top of it. DrawDebugData uses raw opengl calls to draw everything. Is there something I'm not doing, like swapping the buffers or something? I thought that was essentially what Display() did.
_window->Clear(sf::Color::Black);
_world->DrawDebugData();
_window->Draw(circle);
_window->Display();
I mean, I'm pretty sure I'll always be drawing something along with the debug data. It'd just be nice to know why this is and what I'm doing wrong, if anything. My friend and I were sitting there for over an hour trying to figure out why the debug data wasn't drawing, and then I decided to draw a sf::Shape just to test it out and that made the debug data show up all of a sudden.
Thanks!