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

sglTextureCubeMap.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: sglTextureCubeMap.hpp
00021  *  Created: 30 November 2001
00022  *  Summary: container for 2D image data used for cube map texturing
00023  *****************************************************************************/
00024 
00025 #ifndef __SGL_TEXTURE_CUBE_MAP_HPP
00026 #define __SGL_TEXTURE_CUBE_MAP_HPP
00027 
00028 #include <sgl.h>
00029 #include <vector>
00030 #include <sglObject.hpp>
00031 #include <sglVector.hpp>
00032 #include <sglTexture.hpp>
00033 
00034 //============================================================================
00035 
00114 class SGL_DLL_API sglTextureCubeMap : public sglTexture
00115 {
00116 public:
00118    sglTextureCubeMap();
00119 
00121    virtual ~sglTextureCubeMap();
00122 
00144    bool setImage(void *px_image,
00145                  void *nx_image,
00146                  void *py_image,
00147                  void *ny_image,
00148                  void *pz_image,
00149                  void *nz_image,
00150                  ExternalFormatEnum format,
00151                  TypeEnum type,
00152                  unsigned int size,
00153                  bool border = false);
00154 
00168    void getImage(void *&px_image,
00169                  void *&nx_image,
00170                  void *&py_image,
00171                  void *&ny_image,
00172                  void *&pz_image,
00173                  void *&nz_image,
00174                  ExternalFormatEnum &format,
00175                  TypeEnum &type,
00176                  unsigned int &size,
00177                  bool &border) const;
00178 
00182    bool setMipmapLevels(const vector<void *> &) { return false; }
00183 
00187    inline unsigned int getSize() const { return m_size; }
00188 
00192    virtual unsigned int getIdealInternalSize() const;
00197    virtual unsigned int getLikelyInternalSize() const;
00198 
00204    void setWrapMode(WrapEnum s_repeat_flag, WrapEnum t_repeat_flag);
00205 
00212    void getWrapMode(WrapEnum &s_repeat_flag, WrapEnum &t_repeat_flag) const;
00213 
00219    void setMaxAnisotropy(float max);
00221    float getMaxAnisotropy() const { return m_max_anisotropy; }
00222 
00226    static float getMaxSupportedMaxAnisotropy()
00227       { return sgl::s_max_texture_max_anisotropy; }
00228 
00234    virtual bool checkProxy();
00235 
00241    virtual void bind();
00242 
00243    virtual bool replaceImage(void *, GLint) { return false; }
00244    virtual bool buildMipmaps(vector<void*> &) { return false; }
00245 
00246 private:
00247    sglTextureCubeMap(const sglTextureCubeMap&);              // NOT IMPLEMENTED
00248    sglTextureCubeMap& operator=(const sglTextureCubeMap &);  // NOT IMPLEMENTED
00249 
00250    // helper function for get*InternalSize
00251    unsigned int getNumTexels() const;
00252 
00253 private:
00254    void *m_images[6];
00255 
00256    unsigned int m_size;       // must be square
00257    GLint m_repeat_flag[2];
00258    float m_max_anisotropy;
00259    GLint m_power;             // m_pow_s, m_pow_t
00260 };
00261 
00262 #endif

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