PDA

View Full Version : continous update, "video"



grodslukaren
06-29-2001, 11:50 AM
Hi,

I try to update my OpenGl window letīs say 10 times to make a "video", everything depends on the values Iīve got. Iīm looking
in my debugger and I do go through the function below 10 times when I create the object 10 times and do Refresh() of the OpenGLwindow (wxWindows)

It does only show the last "picture" of the 10 scenes. Have you guys done this before?? What do I have to do??

Thanks!!
/grodslukaren

void C3DPaintCanvas::UpdateScalp()
{
// create the scalp displaylist, overwrite the old one, data from m_pScalpMesh
glNewList(3,GL_COMPILE_AND_EXECUTE);
m_pBody = new CBody3D(m_pScalpMesh->m_pMesh,2);
delete m_pBody;
// destroy the body, donīt needed when stored in displaylist
glEndList();
m_pBody = NULL;
// update the screen
Refresh(true);
}

grodslukaren
06-29-2001, 12:38 PM
If I put a message box between every update it works fine, but I have to click my video manually, and tahtīs not that fun...

The pictures are updated with values sent with events. Is there any problem to send to many events in a row??? I mean, Itīs quiet obvious that it takes more times to create and display my OpenGL figure than it is to send the 10 events. But I thought they are stored in a stack and handled one at a time...

/grodslukaren

harsman
06-30-2001, 03:44 AM
Maybe they just update so fast without the message boxes, that you don't even notice the animation? Also, from the code you posted, it looks like you don't actually store anything in the displaylist but it's hard to know without seeing what goes on in the constructor. Btw, if you need to update a displaylist every frame, you shouldn't really use display lists, they're better for static geometry.