Skip to main content
gamedev.net
🔒 Locked

Quick Texture question

Started by hello_there 4 replies 450+ views
Original Post
hello_there
hello_there
I have a stucture that is used to load textures in my engine. it hold the data and everthing to do with the texture. i was wondering after the texture is loaded is it worth keeping the texture data or just store the number generated by glGenTextures(1, &Texture);
____________How could hell be worse?
Mr Grinch
Mr Grinch
I can''t come up with any reason to keep your copy of the data. As far as I know, it just wastes space. Once the texture object has been created, opengl has it''s own copy of the data to use. I suppose if you need to recreate the texture object for some reason, it would save you a little time reading it from disk again, but I don''t think there''s much need for that. I don''t keep my copies of textures in my project, but maybe someone with more experience knows of reasons to or situations that you would want to...
hello_there
hello_there
yeah that''s what i though. thanks
____________How could hell be worse?
FReY
FReY
You should probably keep your texture around if you want to do procedural or dynamic textures though. That way, all you have to do is reupload the texture once you have changed it. (unless you are doing everything on the pixelshader)
do unto others... and then run like hell.
cyansoft
cyansoft
Another reason you might want to keep the texture data around is if you allow your user to change from windowed to fullscreen mode and vice versa while in the game. When this happens on Windows, you will lose your rendering context (unless I''m doing something wrong). That means you lose all your textures. But it also means losing all your display lists, vertex arrays, VBO''s etc. Since you lose everything, you might as well load everything from disk again (how often will the user want to switch display modes? Not often.) So the answer is No, you do not need to keep the texture data in memory (unless you are doing procedural textures as FReY indicated).

Raloth
Raloth
quote:
Original post by cyansoft
Another reason you might want to keep the texture data around is if you allow your user to change from windowed to fullscreen mode and vice versa while in the game. When this happens on Windows, you will lose your rendering context (unless I''m doing something wrong). That means you lose all your textures. But it also means losing all your display lists, vertex arrays, VBO''s etc. Since you lose everything, you might as well load everything from disk again (how often will the user want to switch display modes? Not often.) So the answer is No, you do not need to keep the texture data in memory (unless you are doing procedural textures as FReY indicated).
*cough*thisisnotdirectx*cough*

OpenGL handles all of that for you.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.