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

emptyTex.h

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 #ifndef GLIFT_EMPTY_TEXTURE_H__
00020 #define GLIFT_EMPTY_TEXTURE_H__
00021 
00022 #include "singleTex.h"
00023 #include <GL/glew.h>
00024 
00025 namespace glift {
00026 
00027 //////////////////////////////////////////////////////////////////////////
00028 ///
00029 /// EmptyTex - A dummy class that serves to enable/disable a texture unit
00030 //                        that is to be used for textureCoords only and has no texture
00031 //                        associated with it.
00032 ///
00033 ///////////////////////////////////////////////////////////////////////
00034 
00035 class _export_ EmptyTex : public CoreTex
00036 {
00037 public:
00038    EmptyTex(); //GL_TEXTURE_2D on unit 0.
00039    EmptyTex( GLenum texDimenName, int texUnit );
00040    EmptyTex( const EmptyTex& rhs );
00041    EmptyTex& operator=(const EmptyTex& rhs);
00042    virtual ~EmptyTex();
00043 
00044    /// Set the texture unit
00045    void texUnit(int t)                                                  {m_texUnit = t;}
00046 
00047    /// Accessors
00048    int                          texUnit() const                 {return m_texUnit;}
00049    virtual PBuffGlift*  pbuff() const                   {return NULL; }         
00050    virtual gutz::vec3i  dimen() const                   {return gutz::vec3i(); }        
00051    virtual bool                 tryToBindPbuff() const  {return false; }
00052 
00053    /// Set Funcs (will issue error message and die)
00054    virtual void setTexData( TexData* texData, int mipLevel=0, bool setTexSize=true ); 
00055    virtual void resetTexState( const VecTexState& texState );   
00056    virtual void tryToBindPbuff( bool tryToUsePbuff );
00057    virtual void copyToTex( int mipLevel, const gutz::vec3i& texOrig, 
00058       const gutz::vec2i& screenOrig, const gutz::vec2i& copySize   );
00059 
00060 
00061 protected:
00062    virtual void bindDef();
00063    virtual void releaseDef();
00064 
00065 private:
00066    int  m_texUnit;
00067 
00068    void initMembers( int texUnit );
00069    void initMembers( const EmptyTex& rhs );
00070    void checkTexUnit( GLuint texUnit );
00071 };
00072 
00073 } /// End of namespace glift
00074 
00075 #endif

Send questions, comments, and bug reports to:
jmk