PDA

View Full Version : how to display image on opengl window



freshiee
11-18-2010, 08:43 AM
hi...
i am new to opengl.
i wrote a program(image processing) using c language and want to display the output(image output) onto opengl window.
could anybody help me to solve this task?

_arts_
11-18-2010, 12:27 PM
I don't really know about image processing, but if you can know each pixel of an image, then you can draw it into a texture, or by drawing pixels directly.

Textures could have the advantage that they can fit whatever size the object you'll draw them onto (and can use filter to look good even if the size is very different from the orginal image). Textures are also stored into graphic memory.

I've never used drawing pixel directly with OpenGL. From what I know, they will be good enough for you if you don't need to change the size (show the image with the exact size, in pixels).

MaxH
11-18-2010, 11:11 PM
... want to display the output(image output) onto opengl window. The most basic way to do this is to use glDrawPixels. I put an example of loading/displaying images & textures at:

OpenGL Images & Textures (http://www.mfwweb.com/OpenGL/Loading_Textures/)