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 2 of 2

Thread: Programming own image loaders for OpenGL 3.2+

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2012
    Posts
    9

    Programming own image loaders for OpenGL 3.2+

    Hey everyone

    Recently I've started to take a bit more interest in how image loading/decoding is actually done. Especially because at times I want to use frameworks such as LWJGL with OpenGL 3.2+, which as far as I can see, haven't gotten up to speed with supporting utilities within libraries such as SlickUtil that really works with the newer OpenGL versions, but perhaps I'm mistaken.

    Anyways it got me curious about the whole process of creating image loaders/decoders such as functions to read in PNG files or JPEG files and then convert them into OpenGL textures etc.

    I did some searching around but I really haven't been able to find any resources on how to get started with writing your own image loaders. I'm thinking it could be a great learning experience.

    Is there anyone who have any tips on what resources would be good to read and learn in order to get started with this business?

    Thank you all for your time

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    894
    Hmm, how does the OpenGL version affect the image loader library you use? - I usually consider uploading textures to OpenGL a two step process: first you use an image loader library to get the data into main memory and second use your favorite graphics library (or direct OpenGL calls) to get the data into textures.

    For the two formats you mention you only need to go to websites of the canonical loader libraries libpng and libjpeg for information on the file formats and the code to read them.

    I don't know the situation for java, but for c/c++ there are dozens of image loading libraries, so the design space for these things seems fairly well explored...

Posting Permissions

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