Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

glt/viewport.h

Go to the documentation of this file.
00001 #ifndef GLT_VIEWPORT_H
00002 #define GLT_VIEWPORT_H
00003 
00004 /*
00005 
00006   GLT OpenGL C++ Toolkit      
00007   Copyright (C) 2000-2002 Nigel Stewart
00008   Email: nigels.com@gmail.com   WWW: http://www.nigels.com/glt/
00009       
00010   This library is free software; you can redistribute it and/or
00011   modify it under the terms of the GNU Lesser General Public
00012   License as published by the Free Software Foundation; either
00013   version 2.1 of the License, or (at your option) any later version.
00014 
00015   This library is distributed in the hope that it will be useful,
00016   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018   Lesser General Public License for more details.
00019 
00020   You should have received a copy of the GNU Lesser General Public
00021   License along with this library; if not, write to the Free Software
00022   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023 
00024 */
00025 
00043 #include <glt/config.h>
00044 #include <glt/gl.h>
00045 
00046 #include <iosfwd>
00047 
00053 typedef enum GltHorizontalAlignment
00054 {
00055     GLT_ALIGN_LEFT = 0,
00056     GLT_ALIGN_HCENTER,
00057     GLT_ALIGN_RIGHT
00058 } GltHorizontalAlignment;
00059 
00065 typedef enum GltVerticalAlignment
00066 {
00067     GLT_ALIGN_TOP = 0,
00068     GLT_ALIGN_VCENTER,
00069     GLT_ALIGN_BOTTOM
00070 } GltVerticalAlignment;
00071 
00072 class GltTexture;
00073 
00081 class BoundingBox;
00082 
00083 class GltViewport
00084 {
00085 public:
00086     
00088     GltViewport(bool getIt = false);
00090     GltViewport(const GltViewport &viewport);
00092     GltViewport(const GLint x,const GLint y,const GLint width,const GLint height);
00094     ~GltViewport();
00095 
00097     bool valid() const;
00098 
00100     void get();
00101 
00103     void set() const;
00105     void set(const GLint width,const GLint height);
00107     void set(const GLint x,const GLint y,const GLint width,const GLint height);
00108 
00110     GLint &x();
00112     GLint &y();
00114     GLint &width();
00116     GLint &height();
00117 
00119     const GLint &x() const;
00121     const GLint &y() const;
00123     const GLint &width() const;
00125     const GLint &height() const;
00126 
00128     const GLint  pixels() const;
00129 
00131     operator       GLint *();
00133     operator const GLint *() const;
00134 
00136     bool resize(const GLint width,const GLint height);
00138     bool resize(const GLint x,const GLint y,const GLint width,const GLint height); 
00140     bool resize(const GltTexture &texture);
00142     bool resize(const BoundingBox &box);
00143     
00145     bool align(const GltHorizontalAlignment &align,const GltViewport &window);
00147     bool align(const GltVerticalAlignment   &align,const GltViewport &window);
00148 
00150     bool shrink(const GLint w);
00151 
00152     //
00153 
00155     GltViewport &operator=(const GltViewport &viewport);
00156 
00158     bool operator==(const GltViewport &viewport) const;
00160     bool operator!=(const GltViewport &viewport) const;
00161 
00162     //
00163 
00165     void drawQuad() const;
00167     void drawLines() const;
00168 
00169 private:
00170     GLint _viewport[4];
00171 };
00172 
00173 #endif

Generated on Tue Nov 5 11:11:04 2002 for GLT by doxygen1.2.18