PDA

View Full Version : glutPostRedisplay() in another thread?



Shahzad
09-18-2009, 07:40 AM
Hi, I made a 3D face model using OpenGL and OpenCV. Now I am in the process of matching it to face images. I have coded particle swarm optimization. The problem(or question) is: Since my card does not support offscreen rendering(FBOs), its an Intel 945GM.

I have to optimize using on-screen rendering, and as all optimization algorithms its iterative and requires continuous redisplay. In summary, I run an iteration (for-)loop and inside I want to redisplay the window, but whats happening is all glutPostRedisplay() calls are stacked and executed only one time at the end of the loop. because the next instance the glutMainLoop() gets to run display callback is after for loop completion/exit.

What do you make of it? Or is there any better way then on-screen rendering.

Thanks so much in advance for any help and even more thanks for quicker help.


P.S. I am using VertexArrays, shape/texture/normal values of a point cloud, triangulation and lighting.

ZbuffeR
09-18-2009, 08:05 AM
Basically you don't need an event-driven framework like GLUT. Either do it by hand for your target OS, or use GLFW, which is very simple to use. Just call your rendering every time you need it.

Shahzad
09-18-2009, 08:39 AM
Thanks for help. Can you please say a little about how can I render everytime I need? I mean where should I put the transformations without creating a window? or how to create a window without GLUT? any link to source of such information would be sufficient. THanks again

ZbuffeR
09-18-2009, 10:25 AM
come on :)
http://lmgtfy.com/?q=glfw
they have really good docs and tutorials.

Shahzad
09-18-2009, 02:13 PM
hehehe :) I meant not GLFW, I was there already. I meant without that. thanks anyway, will be working on GLFW!
:)