/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/src/sgx/graphics/texturebank.cpp

*/

#include "sgx/core/core.hpp"
#include "sgx/graphics/graphics.hpp"


tUINT32 
CSGXTextureBank::add(CSGXTexture *pTexture) {
	if (pTexture) {
		m_TextureList.push_back(pTexture);
		return m_TextureList.size()-1;
	} 
	return (tUINT32)-1;
}
 
CSGXTexture *
CSGXTextureBank::get(tUINT32 id) {
	if (id < m_TextureList.size()) {
		return m_TextureList[id];
	}
	return NULL;
}
 
 
tUINT32 
CSGXTextureBank::loadTextures(const sgxString &filename) {
sgxVector<CSGXTexture *> textureList;

	CSGXTextureManager::get()->loadTexture(filename, textureList);
	
	sgxVector<CSGXTexture *>::iterator it = textureList.begin();
	for(;it!=textureList.end();++it) {
		add((*it));
	}	

	return textureList.size();
}

 
