X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ftexunit.cpp;h=9277c27704ebd8347c3c6a782fc1b6ff05fc8658;hb=HEAD;hp=bda7599143a11bf05abcf330a58eca6895c3da67;hpb=a4ec5410595ddf37bfbc0e85ad87d31a9cbf94f1;p=libs%2Fgl.git diff --git a/source/texunit.cpp b/source/texunit.cpp deleted file mode 100644 index bda75991..00000000 --- a/source/texunit.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 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) -{ - require_version(1, 3); -} - -bool TexUnit::set_texture(const Texture *tex) -{ - bool result=(tex!=texture); - texture=tex; - return result; -} - -TexUnit &TexUnit::activate(unsigned n) -{ - if(units.size()<=n) - units.resize(n+1); - - 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