Original Post
Hello, I've come to realize that having 50 sprite class objects that loads in the same exact image is a waste of memory. I want to make it so that any future sprite class object that loads in a image which already resides in memory to point to the memory location of which the already loaded sprite resides.... [Edited by - Khaosifix on January 10, 2005 12:13:06 PM]
class cShip : cObject
{
// Same stuff as cObject but defined.
cSprite m_sTexture ;
} ;
std::vector<cObject*> g_EnemyShips( 50 ) ;
GLvoid cGame::SetupData( )
{
// define all 50 elements in a loop obviously
// The problem lies here though. When 50 cObject/cShip objects
// are defined here 50 of the same texture/image are loaded
// via cSprite. From my judgment it is a bad idea to have 50
// of the game images loaded into memory. Any suggestions?
}