arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

emptyTex.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////
00002 // 6/13/02      Aaron Lefohn    Scientific Computing and Imaging Institute
00003 // School of Computing          University of Utah
00004 //
00005 //  This library is free software; you can redistribute it and/or
00006 //  modify it under the terms of the GNU Lesser General Public
00007 //  License as published by the Free Software Foundation; either
00008 //  version 2.1 of the License, or (at your option) any later version.
00009 //
00010 //  This library is distributed in the hope that it will be useful,
00011 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 //  Lesser General Public License for more details.
00014 //
00015 //  You should have received a copy of the GNU Lesser General Public
00016 //  License along with this library; if not, write to the Free Software
00017 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 ////////////////////////////////////////////////////////////////////////
00019 
00020 #include <texture/emptyTex.h>
00021 #include <iostream>
00022 #include <util/gliftUtil.h>
00023 
00024 using namespace std;
00025 using namespace gutz;
00026 
00027 using namespace glift;
00028 
00029 extern const GLenum g_texUnitName[NUM_TEX_UNIT_NAMES];
00030 
00031 EmptyTex::EmptyTex()
00032 : CoreTex( GL_TEXTURE_2D, MultiTexOState(), NULL, NULL )
00033 {
00034    initMembers( 0 );
00035 }
00036 
00037 EmptyTex::EmptyTex( GLenum texDimenName, int texUnit )
00038 : CoreTex( texDimenName, MultiTexOState(), NULL, NULL )
00039 {
00040    initMembers( texUnit );
00041 }
00042 
00043 EmptyTex::EmptyTex( const EmptyTex& rhs )
00044 : CoreTex( rhs.texType(), MultiTexOState(), NULL, NULL )
00045 {
00046    initMembers( rhs );
00047 }
00048 
00049 EmptyTex& EmptyTex::operator=(const EmptyTex& rhs)
00050 {
00051    if( &rhs != this ){
00052 
00053       initMembers( rhs );
00054    }
00055    return *this;
00056 }
00057 
00058 EmptyTex::~EmptyTex()
00059 {}
00060 
00061 void EmptyTex::initMembers( int texUnit )
00062 {
00063 #ifndef GL_ARB_multitexture
00064    err() << "initMembers() Error:\n"
00065       << "\tGL_ARB_multitexture is not defined.\n"
00066       << "\tEmptyTexture is not available.\n";
00067    exit(1);
00068 #endif
00069 
00070    m_texUnit = texUnit;
00071 
00072    checkTexUnit( m_texUnit  );
00073 }
00074 
00075 void EmptyTex::checkTexUnit( GLuint texUnit )
00076 {
00077    if( texUnit > (uint)getLimitsGL().maxTexUnits ) {
00078       err() << "checkTexUnit(...) Error:\n\t'texUnit' ( " << texUnit << " ) is "
00079          << "larger than glim.max_tex_units (" << getLimitsGL().maxTexUnits << ").\n";
00080       exit(1);
00081    }
00082 }
00083 
00084 void EmptyTex::initMembers( const EmptyTex& rhs )
00085 {
00086    initMembers( rhs.m_texUnit );
00087 }
00088 
00089 void EmptyTex::bindDef()
00090 {
00091    glActiveTexture( g_texUnitName[ m_texUnit ] );
00092    glEnable(texType());
00093 
00094    glErr(estr(),"EmptyTex:bindDef()");
00095 }
00096 
00097 void EmptyTex::releaseDef()
00098 {
00099    glActiveTexture( g_texUnitName[ m_texUnit ] );
00100    glDisable(texType());
00101    glActiveTexture( g_texUnitName[0] );
00102 
00103    glErr(estr(),"EmptyTex:release()");
00104 }
00105 
00106 void EmptyTex::setTexData( TexData* texData, int mipLevel, bool setTexSize )
00107 {
00108    err() << "setTexData(...) Error:\n"
00109       << "\tCall has no meaning.\n";
00110    exit(1);
00111 }
00112 
00113 void EmptyTex::resetTexState( const VecTexState& texState )
00114 {
00115    err() << "resetTexState(...) Error:\n"
00116       << "\tCall has no meaning.\n";
00117    exit(1);
00118 }
00119 
00120 void EmptyTex::tryToBindPbuff( bool tryToUsePbuff )
00121 {
00122    err() << "tryToBindPbuff(...) Error:\n"
00123       << "\tCall has no meaning.\n";
00124    exit(1);
00125 }
00126 
00127 void EmptyTex::copyToTex( int mipLevel, const gutz::vec3i& texOrig, 
00128                          const gutz::vec2i& screenOrig, const gutz::vec2i& copySize   )
00129 {
00130    err() << "copyToTex(...) Error:\n"
00131       << "\tCall has no meaning.\n";
00132    exit(1);
00133 }
00134 
00135 
00136 

Send questions, comments, and bug reports to:
jmk