I am trying to grab images using MIL library and I wanted to render the image to glCanvas window using OpenGL. However, the problem is my
OnPaint( wxPaintEvent &event)
method is not running in a loop to show the pictures. I have put code in this method to grab images using MIL and set them as textures before displaying them. So, if wxPaintEvent is running itself in a loop, why don’t I see an image sequence, like a video? When I check with default texture without using MIL, its working. So, basically, I’m just setting the textures!
I’m not using interprocess and mutexes, could this be a problem? Or, do I need to be more careful about timing of this event?
Paint events are usually only issued if the window has been marked as “invalid” or “dirty”, and is deemed to require a redraw. If you want to play an animation, either mark the window as subject your redraw yourself ( wxWindow::Refresh ). Or, the preferred method, register an idle event handler and perform OpenGL operations from there: http://wiki.wxwidgets.org/Making_a_render_loop