View Full Version : RGB image display

04-17-2004, 04:54 AM

I am a newbie to OpenGL. I want to display 24bit RGB (8,8,8) data of size 640x480 using OpenGL.My development target is Linux. So I found an example program to display a bitmap file at


Using this example program i am able to display 128x128 image only. But not fullfill my requirement. How can i achieve this using OpenGL?

With Thanks & Regards,

04-17-2004, 03:35 PM
Why can you only display 128x128? Does the application crash, give you an error, or does it just not display anything?

If your graphics hardware can display textures no larger than 128x128, there's not a lot you can do about it. If the resolution of the 640x480 graphic can be dropped you could stretch it to cover the screen.

Otherwise, you could load a number of 128x128 graphics and tile them to create the effect of a much larger textured quad.

Also, note that non-power-of-two textures may not be supported on your hardware - 640 and 480 are non-power-of-two. You'd need to draw your 640x480 image in one corner of a 1024x512 image, then modify your texture coordinates to texture the quad with just the 640x480 part.

04-19-2004, 10:53 PM

Thanks for ur reply cfmdobbie. I got success in displaying images of different resolutions. My requirement is to display 24-bit 1280x960 image data from camera over OpenGL at a rate of 30fps.
The problem is the time taken for displaying the 1280x960 image data is 2.23 seconds. I am using the function glDrawPixels() for displaying the image data from the camera.
Is there any way to achieve the number of frames per second.

With Thanks & Regards,

04-20-2004, 04:43 AM

1280x960 = 1,228,800 pixels, 24-bit = 3 bytes/pixel, so one frame = 3,686,400 bytes. At 30fps, that comes to 110,592,000 bytes per second.

Is there any chance of relaxing your requirements? That's one hell of a lot of data you're trying to push.