Thread: Texture Management in OpenGL

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Making mistakes
    Join Date
    Dec 2008
    Posts
    476

    Texture Management in OpenGL

    Hi folks,

    I'm currently learning OpenGL by NeHe whilst packing all my knowledge into a C++ Engine. So far, I'm at chapter 6 (textures). The question is:
    How can I manage my textures dynamically?

    I thought of a dynamically allocated array holding the texture IDs.
    Well, I have two options:
    1. Allow the user to dynamically delete and add textures, which is practical but also kinda difficult to implement (fill in empty slots etc. so that the ID for a texture doesn't change) and a certain amount of overhead

    2. Allow the user to have one dynamically allocated array, only being able to add textures and clear the array entirely. This would be easier, but how can I increase the size of the array and still having old textures work? By repeatedly calling glGenTextures and glTexImage2D?

    3. Have one array of a specific size and being able to replace it completely (like number 2 without dynamically adding textures)

    I prefer the second choice. But I need help implementing it.

    EDIT: I have already searched in the forum, sorry if someone else's asked this before
    Last edited by Brafil; 07-09-2009 at 05:00 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Texture Binding with OpenGL
    By scwizzo in forum Game Programming
    Replies: 5
    Last Post: 07-01-2008, 11:02 AM
  2. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  3. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  4. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  5. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM