Displaying of real-time camera images

How can I display a camera image in real time, more precicely, how can I make OGL grab an image fram and display it using glDrawPixels() or textures?

Opengl have no way of reading data from cameras or similar ( maybe OpenML adresses that problem, but thats not finished anyway), so you have to use OS dependent techniques to grab the image, then just upload it as a texture and use it. If the texture arent to huge its possible to get good FPS that way.

nehe.gamedev.net has a tutor on playing a AVI in openGL.

Maybe could use the same code to play a video stream from a camera.

Originally posted by thomap:
How can I display a camera image in real time, more precicely, how can I make OGL grab an image fram and display it using glDrawPixels() or textures?