Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: What are u all using to load textures for OpenGL?

  1. #1
    Member Contributor Bluebomber357's Avatar
    Join Date
    Oct 2008
    Posts
    92

    What are u all using to load textures for OpenGL?

    I have been trying to load a texture for a while now with no luck. All the tutorials I find use glaux , are for .raw files (I prefer .bmp, .png, or .jpg), or the majority just skip over that part and talk about the actual texturing code...

    What do you guys use to load textures? I am very curious, openGL has been around forever, I thought texturing would be absolutely trivial to get working, please help
    The Blue Guy Always Wins

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    Re: What are u all using to load textures for OpenGL?

    Try DevIL
    GLIM - Immediate Mode Emulation for GL3

  3. #3
    Member Contributor Bluebomber357's Avatar
    Join Date
    Oct 2008
    Posts
    92

    Re: What are u all using to load textures for OpenGL?

    I looked at DevIL, but I cannot figure out how to install it on VS2008...

    I am trying to get SOIL, simple opengl image loader to work, but I get some linking error, probably because I can't find the static library file or I am linking it in the wrong spot. The file in SOIL's lib folder is a .a file, wth is a .a file...

    Any help on DevIL or SOIL, or anything that can load a image would be greatly appreciated
    The Blue Guy Always Wins

  4. #4
    Senior Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Czech Republic
    Posts
    317

    Re: What are u all using to load textures for OpenGL?


  5. #5
    Junior Member Newbie
    Join Date
    Aug 2008
    Location
    Hungary
    Posts
    8

    Re: What are u all using to load textures for OpenGL?

    I found SOIL the best, but all of them works correctly.
    .a is the lib file for gcc, mingw.
    To make soil work, you have to compile and copy the LIB file, and copy the SOIL.h into your compiler.
    Go to the SOIL/projects/VC? folder, and open the project to do it.
    Then you find everything to load an image at the official website:
    http://lonesock.net/soil.html

    I use Codeblocks btw, but it should work with VS2008 too.

  6. #6
    Member Contributor Bluebomber357's Avatar
    Join Date
    Oct 2008
    Posts
    92

    Re: What are u all using to load textures for OpenGL?

    The projects that come with SOIL won't compile for me

    I am trying to get FreeImage to work, I found an example project on codesampler.com that compiles and works, but I am having trouble getting it to work in my own project.

    ***UPDATE***
    I am still having trouble. The example of FreeImage and Opengl I got from codesampler.com does not use GLUT, and I am getting a lot of errors. If anyone has a good GLUT + OpenGL texture example that will compile in Visual Studio let me know
    The Blue Guy Always Wins

  7. #7
    Senior Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    744

    Re: What are u all using to load textures for OpenGL?

    i wrote my own TGA loader (as a lesson for nehe.gamedev.net)
    feel free to use it if you like
    nehe_tga.rar

  8. #8
    Member Contributor Bluebomber357's Avatar
    Join Date
    Oct 2008
    Posts
    92

    Re: What are u all using to load textures for OpenGL?

    thanks for the offer, but I really want to load bmps, jpegs, or pngs.

    I am finding this process extremely painful. There are so many examples and libraries to get this simple task done, but I cannot get any of them to work with my existing project, and sometimes not at all. How do you all cope with all the differences in IDE, libraries, C++ random crap, and more?
    The Blue Guy Always Wins

  9. #9
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    Re: What are u all using to load textures for OpenGL?

    Loading textures is far from simple if you want to support some common file formats. DevIL is actually pretty easy to use with Visual Studio but i haven't used it in a while. I wrote my own importers for TGAs and DDS files. TGAs are really easy to handle, that was the reason for me to use them. DDS files are the most interesting files, because they can store all the stuff like DXT compressed images, 1D, 2D, 3D, Cubemap textures, with mipmaps or without. It was a pain to write a loader for that format but it was really worth the effort. Textures load like 5x faster than from TGAs now and i have full control over the data.

    However it seems that you have to get a bit more used to how to get other peoples software working in your projects. I would pick one library and not hop to the next only because it doesn't work right away. C++ is difficult in that regard, but that's a skill that you need to learn.

    Jan.
    GLIM - Immediate Mode Emulation for GL3

  10. #10
    Member Contributor Bluebomber357's Avatar
    Join Date
    Oct 2008
    Posts
    92

    Re: What are u all using to load textures for OpenGL?

    I am happy to hear that this isn't a trivial process. I am all for any library that has some good documentation on how to use it. Can anybody point me in a good direction? I am dying to mess around with cube maps, multi-texturing, and "glyph-bombs" as GLSL book puts it (the orange one).
    The Blue Guy Always Wins

Page 1 of 3 123 LastLast

Similar Threads

  1. load aunknown number of textures to opengl.
    By Özgür Özön in forum OpenGL: Windows
    Replies: 1
    Last Post: 03-15-2012, 05:14 AM
  2. Load textures with LWJGL? How?
    By DarkPeterII in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 06-18-2011, 05:05 AM
  3. Replies: 1
    Last Post: 09-30-2007, 05:58 PM
  4. How to load JPG for textures
    By jirkamelich in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-08-2002, 01:26 AM
  5. Load textures in my project
    By biagio in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-24-2001, 05:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean