GZDoom Texture Handling
Posted: Tue Nov 22, 2005 3:25
Face it, the source is huge. How does GZDoom extract a texture out of a wad and put it into OpenGL? This is what I assume happens:
1. The texture is loaded into the heap along with the pallette
2. DevIL does some voodoo to turn this memory into a texture
3. Use texture as regular OpenGL.
How do you get DevIL to return a proper OpenGL texture reference? I havn't been able to find any good example on how exactly this is done.
Here's my hunch:
Use ilLoadL() to load the image from memory
Use ilutGLBindMipmaps() to return a texture reference and build mipmaps?
I'm not sure of the use of ilGenImages(), and ilBindImage(). The docs talk about "a named image", but I'm not really sure what they're going on about, because I see no "names" involved. I'm not really following how DevIL processes images, and if you can store them later on in DevIL's internal format (I assume converting from memory to it's own format is taxing), and if I can, how do I reference to it?
1. The texture is loaded into the heap along with the pallette
2. DevIL does some voodoo to turn this memory into a texture
3. Use texture as regular OpenGL.
How do you get DevIL to return a proper OpenGL texture reference? I havn't been able to find any good example on how exactly this is done.
Here's my hunch:
Use ilLoadL() to load the image from memory
Use ilutGLBindMipmaps() to return a texture reference and build mipmaps?
I'm not sure of the use of ilGenImages(), and ilBindImage(). The docs talk about "a named image", but I'm not really sure what they're going on about, because I see no "names" involved. I'm not really following how DevIL processes images, and if you can store them later on in DevIL's internal format (I assume converting from memory to it's own format is taxing), and if I can, how do I reference to it?