PDA

View Full Version : Display frame grabber acquisitions



sindri
02-19-2002, 07:20 AM
I have to display the acquisitions captured by a frame grabber at 25 frame/second with a resolution of 768x576 pixels.
I know that it is preferable to use texture instead of glDrawPixel, i try to use it but it doesn't seem to be better.
Perhaps i'm getting wrong something...

Thanks

S.

zed
02-19-2002, 10:41 PM
to update the texture are u using glTexSubImage2d(..) ie not glteximage2d(..)

sindri
02-28-2002, 04:32 AM
In my display function i wrote:
...
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 768, 576, GL_LUMINANCE, GL_UNSIGNED_BYTE, pImage);
glEnable(GL_TEXTURE_2D);
glBegin(GL_QUADS);
glTexCoord2f(0, 0); glVertex2f( 0, 0);
glTexCoord2f(0, 576/1024); glVertex2f( 0, 576);
glTexCoord2f(768/1024, 576/1024); glVertex2f(768, 576);
glTexCoord2f(768/1024, 0); glVertex2f(768, 0);
glEnd();
...
Is that all right?
It takes about 250 msec on a 933MHz Pentium III... amazing!
I'm crying for it... http://www.opengl.org/discussion_boards/ubb/confused.gif

zeckensack
02-28-2002, 05:20 PM
Have you specified your texture (at initial creation) with internal format GL_LUMINANCE8? Even then, maybe your HW doesn't natively support this format.

[This message has been edited by zeckensack (edited 02-28-2002).]

sindri
02-28-2002, 11:10 PM
Yes, i have! But i tryed with GL_RGBA also and it is the same thing...