#include "cTextureManager.h"


cTextureManager* cTextureManager::instance_ = 0;

cTextureManager* cTextureManager::instance()
{
    if(instance_ == 0)
        instance_ = new cTextureManager;
    return instance_;
}

cTextureManager::cTextureManager()
{
    gemTexture_.loadTGA("icespheremap.tga", true);
    exploderTexture_.loadTGA("waterdrop.tga", false);
	bgTexture_.loadTGA("background.tga", false);
    
    boundTexture_ = NULL;
}

void cTextureManager::bindGemTexture()
{
    boundTexture_ = &gemTexture_;
    gemTexture_.bindGLTexture();
}

void cTextureManager::bindExploderTexture()
{
    boundTexture_ = &exploderTexture_;
    exploderTexture_.bindGLTexture();
}

void cTextureManager::bindBGTexture()
{
	boundTexture_ = &bgTexture_;
    bgTexture_.bindGLTexture();
}

void cTextureManager::unbindTexture()
{
    boundTexture_->unbindGLTexture();
    boundTexture_ = NULL;
}