So, I'm unceremoniously jury-rigging the Box2D sample code together with my own engine. Just dropping Box2D into an engine seems to be pretty straightforward, but I want the GLUI controls and all the nice debug drawing stuff in there as well, which is proving to be a bit more awkward.
My engine does all of its updating and all if its rendering in 2 seperate functions, because this seems like a reasonable thing to do. The problem I'm having is that stepping the physics engine forward also invokes the DebugDraw functions to draw the stuff. Then when it comes to render, I clear the screen, draw my scene, and swap the buffers, which means that the DebugDraw stuff always ends up on the back buffer and never gets rendered. I've temporarily fixed it by moving the physics update into the render function, which is obviously quite a silly thing to do.
My question is how did you intend the DebugDraw stuff to be used? Am I supposed to use the DebugDraw to just calculate and store a list of vertices, which then actually get drawn later in my render function? I'm quite happy to just use the immediate mode rendering stuff in the testbed code if that's possible, but it doesn't seem to be doable with things set up as they currently are. Are there plans to seperate out the DebugDraw stuff in some way so I can step the physics with one function and render the results with another, or am I just doing it wrong?
My engine does all of its updating and all if its rendering in 2 seperate functions, because this seems like a reasonable thing to do. The problem I'm having is that stepping the physics engine forward also invokes the DebugDraw functions to draw the stuff. Then when it comes to render, I clear the screen, draw my scene, and swap the buffers, which means that the DebugDraw stuff always ends up on the back buffer and never gets rendered. I've temporarily fixed it by moving the physics update into the render function, which is obviously quite a silly thing to do.
My question is how did you intend the DebugDraw stuff to be used? Am I supposed to use the DebugDraw to just calculate and store a list of vertices, which then actually get drawn later in my render function? I'm quite happy to just use the immediate mode rendering stuff in the testbed code if that's possible, but it doesn't seem to be doable with things set up as they currently are. Are there plans to seperate out the DebugDraw stuff in some way so I can step the physics with one function and render the results with another, or am I just doing it wrong?