viewport.hpp

Go to the documentation of this file.
00001 /*
00002     RenderStack  Support library for OpenGL 3+
00003     Copyright (C) 2010  Timo Suoranta
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 */
00019 
00027 #ifndef VIEWPORT_HPP
00028 #define VIEWPORT_HPP
00029 
00030 #include "renderstack/rs.h"
00031 
00032 namespace renderstack {
00033 
00035 class viewport
00036 {
00037 public:
00038     viewport(int x = 0, int y = 0, int width = 0, int height = 0);
00039 
00040 public:
00041     void set(int x, int y, int width, int height);
00042 
00043     int   border() const { return m_border; }
00044     float x() const { return m_x; }
00045     float y() const { return m_y; }
00046     float width() const { return m_width; }
00047     float height() const { return m_height; }
00048     float aspect_ratio() const { return m_aspect_ratio; }
00049 
00050 private:
00051     int   m_border;
00052     float m_x;
00053     float m_y;
00054     float m_width;
00055     float m_height;
00056     float m_aspect_ratio;
00057 };
00058 
00059 }
00060 
00061 #endif
00062 
Generated on Sun Apr 11 12:23:09 2010 for RenderStack by  doxygen 1.6.3