Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglTexEnv.hpp

00001 /*****************************************************************************
00002  * SGL: A Scene Graph Library
00003  *
00004  * Copyright (C) 1997-2001  Scott McMillan   All Rights Reserved.
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the Free
00018  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  *****************************************************************************
00020  *     File: sglTexEnv.hpp
00021  *  Created: 2 May 1999
00022  *  Summary: create, modify and query texture environment
00023  *****************************************************************************/
00024 
00025 #ifndef __SGL_TEXENV_HPP
00026 #define __SGL_TEXENV_HPP
00027 
00028 #include <sgl.h>
00029 #include <sglStatelet.hpp>
00030 #include <sglVector.hpp>
00031 
00032 class sglTexCombinerParams;
00033 
00034 //============================================================================
00035 
00064 class SGL_DLL_API sglTexEnv : public sglTexturingStatelet
00065 {
00066 public:
00068    enum ModeEnum
00069    {
00071       eDECAL    = GL_DECAL,
00072 
00076       eREPLACE  = GL_REPLACE,
00077 
00079       eMODULATE = GL_MODULATE,
00080 
00084       eADD      = GL_ADD,
00085 
00089       eBLEND    = GL_BLEND,
00090 
00095       eCOMBINE  = GL_COMBINE
00096    };
00097 
00098 public:
00102    sglTexEnv();
00103 
00105    virtual ~sglTexEnv();
00106 
00113    void setMode(ModeEnum mode);
00114 
00119    ModeEnum getMode() const { return m_mode; }
00120 
00128    void setBlendColor(float r, float g, float b, float a);
00129 
00136    void getBlendColor(float &r, float &g, float &b, float &a) const;
00137 
00143    void setCombinerParams(sglTexCombinerParams *params);
00144 
00148    sglTexCombinerParams* getCombinerParams() const
00149       { return m_combiner_params; }
00150 
00158    void setLODBias(float bias);
00159 
00163    float getLODBias() const { return m_lod_bias; }
00164 
00165    // See sglTexturingStatelet::applyToUnit() for details.
00166    void applyToUnit(sglCurrState *curr_state, unsigned int unit) const;
00167 
00168    // See sglStatelet::getSorted() for details.
00169    virtual bool getSorted() const { return true; }
00170 
00171    // See sglObject::printInfo() for details.
00172    virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00173 
00174 private:
00175    sglTexEnv(const sglTexEnv &);  // not implemented
00176    sglTexEnv &operator=(const sglTexEnv &); // not implemented
00177 
00178    void setIndex();
00179 
00180 private:
00181    ModeEnum m_mode;
00182    sglVec4f m_blend_color;
00183    float m_lod_bias;
00184    sglTexCombinerParams *m_combiner_params;
00185 };
00186 
00187 #endif

Generated at Mon Jul 1 18:00:06 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001