Archived

This topic is now archived and is closed to further replies.

MarsuGL

texture managment

Recommended Posts

hello, i''m trying to make a texture manager using opengl, any advices about technical features or advices are welcomed, i need your experience in this field to know more before to think at coding. Cheers, Marsu

Share this post


Link to post
Share on other sites
I was talking about this to someone about 3 days ago. Texture managers (sometimes called "Texture Caches") aren''t really needed now a days. Of course, what you may want is a well designed TEXTURE class to hold information for a single texture, and has functions to load BMPs, TGAs, and the like. Also has functions to bind itself, and delete itself.

------------------------------
Trent (ShiningKnight)
E-mail me
OpenGL Game Programming Tutorials

Share this post


Link to post
Share on other sites
hello,
can you explain why do you think it''s not needed nowadays ?

in reality the problem that i have is :
must i load all the textures at startup or one by one during the level (it''s for a game) ?

many people have put me on the way of the texture manager

so ?

Share this post


Link to post
Share on other sites
I created a 2D tiled map editor some tim ago, and ran into this problem. Here''s my solution: Create a text file with all the names of your textures in it, i.e.

data/grass_001.bmp
data/land_001.bmp
...etc, etc

Then write a function that will look at each line of the file and load the corresponding texture file. This saved *hours* of tedious code writing. All you need to do is have an array (or linked list) of textures and load the all into that data structure. Hope that helps.

Ignite Software Ltd.

Share this post


Link to post
Share on other sites
I hope I''m not too late but there is a function in openGL to set up the priority of your textures...

I have never used it but I think you just have to enable it and set all your textures a proority number and openGL will do its best to load the good textures when needed...

Hmmm... I''m talking of stuff I don''t know and I hate that but I just wanted to help

Biere et punk

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Texture Managers arent needed? Um, i think I have to disagree here buddy. First of all, not everyone in the world has a Gig of ram laying around to shove all that data into if you have tons of textures like most games today have. What if you were like me, and had 96 megs of ram, and a games textures were roughly 200 megs, wich is tame by todays standards. Where are you going to put all those textures, virtual mem? ack!!! You need to manage them, and a texture manager is a good idea.


Share this post


Link to post
Share on other sites