Texture manager class - Printable Version

+- Forums (
+-- Forum: Community (
+--- Forum: Feature Requests (
+--- Thread: Texture manager class (/showthread.php?tid=158)

Texture manager class - thelusiv - 11-30-2005

We need a class that handles textures instead of all the other classes having to keep track of them...I think it should do the following:<ul><li>texture loading<li>texture unloading<li>texture drawing<li>keep a reference to each loaded texture (GLuint)<li>if a request to load a texture is made after that texture has already been loaded, just return the stored reference to the texture (don't load it again)<li>keep up with sizes of textures somehow?<li>simplify the way we handle textures<li>handle reloading all the textures if the texture size changes</ul>what else?

Texture manager class - joevenzon - 11-30-2005

sounds good, i wouldn't mind writing itwhat sort of priority? should i be working on that or putting the new track system into the game or improving the track editor?

Texture manager class - thelusiv - 12-01-2005

I'd say if you think it won't take too long, work on the texture manager first. It doesn't seem to me like it'd be terribly hard...half of the functions are already in utility.cpp. It's just a matter of wrapping it up into a nice class with some extra management stuff. I'm thinking of a way to use a <pre>map&lt;string, GLuint&gt;</pre> to map filenames to texture references which would make writing it pretty simple. In fact if you like, I could write it, since it really helps out the new GUI classes the most anyway...

Texture manager class - joevenzon - 12-01-2005

okay, i'm pretty much done with this. i don't know what you meant by "texture drawing" in the list above, but everything else should be in SVN shortly

Texture manager class - joevenzon - 12-01-2005

it's in the trunk now

Texture manager class - thelusiv - 12-02-2005

This looks pretty good, I am using it in the Gui class now.I was thinking that it might make sense to move Draw2D from utility.cpp to the texture manager, but actually now that I think about it, that's not exactly necessary.Speaking of Draw2D, it would be nice to be able to draw textures at a certain opacity level, sort of like the font function can. I had to load extra graphics to make the "disabled arrows" on the wheel that I checked in today. The only difference is that it's only 40% opaque so this could be eliminated if there was an opacity parameter in Draw2D.

Texture manager class - joevenzon - 12-02-2005

no problem, that's easy to do. it's in the trunk.