X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexunit.cpp;h=9277c27704ebd8347c3c6a782fc1b6ff05fc8658;hp=622599a213d2481acba6707e573286b0d4145f9d;hb=HEAD;hpb=50e504e2171295d5922ddf87b358e0024db3ce40 diff --git a/source/texunit.cpp b/source/texunit.cpp deleted file mode 100644 index 622599a2..00000000 --- a/source/texunit.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007-2008 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#include "extension.h" -#include "gl.h" -#include "texunit.h" -#include "version_1_3.h" - -using namespace std; - -namespace Msp { -namespace GL { - -TexUnit::TexUnit(): - texture(0) -{ -} - -bool TexUnit::set_texture(const Texture *tex) -{ - bool result=(tex!=texture); - texture=tex; - return result; -} - -bool TexUnit::set_texenv(const TexEnv *env) -{ - bool result=(texenv!=env); - texenv=env; - return result; -} - -TexUnit &TexUnit::activate(unsigned n) -{ - if(units.size()<=n) - units.resize(n+1); - - if(cur_unit!=&units[n] && (cur_unit || n)) - { - static RequireVersion _ver(1, 3); - glActiveTexture(GL_TEXTURE0+n); - } - cur_unit=&units[n]; - - return units[n]; -} - -TexUnit &TexUnit::current() -{ - if(!cur_unit) - return activate(0); - return *cur_unit; -} - -vector TexUnit::units; -TexUnit *TexUnit::cur_unit=0; - -} // namespace GL -} // namespace Msp