Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: how to display image on opengl window

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2010
    Posts
    1

    how to display image on opengl window

    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?

  2. #2
    Member Regular Contributor
    Join Date
    Oct 2010
    Location
    France
    Posts
    466

    Re: how to display image on opengl window

    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).

  3. #3
    Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Los Angeles
    Posts
    386

    Re: how to display image on opengl window

    Quote Originally Posted by freshiee
    ... 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
    Am I doing your homework for you?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •