Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
glfViewport.hh
1 /*
2  This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4  Copyright (C) 2008, 2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10  BIAS is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation; either version 2.1 of the License, or
13  (at your option) any later version.
14 
15  BIAS is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with BIAS; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23  */
24 
25 #ifndef __glfViewport_hh__
26 #define __glfViewport_hh__
27 
28 #include "glfCommon.hh"
29 
30 namespace BIAS {
31 
32  /**
33  * \brief class for setting viewports
34  * \author jkollmann
35  * \ingroup g_openglframework
36  */
37  class BIASOpenGLFramework_EXPORT glfViewport {
38  public:
39  glfViewport();
40  glfViewport(int x, int y, int width, int height);
41 
42  virtual ~glfViewport() {}
43 
44  /**
45  * Sets the position of the upper-left corner
46  * of the viewport in pixel coordinates.
47  */
48  void SetOrigin(int x, int y);
49 
50  /**
51  * Sets the size of the viewport in pixel coordinates.
52  */
53  void SetSize(int width, int height);
54 
55  int GetWidth() const { return width_; }
56  int GetHeight() const { return height_; }
57 
58  /**
59  * Binds the viewport.
60  */
61  virtual void Bind() const;
62 
63  private:
64  GLint x_, y_;
65  GLsizei width_, height_;
66  };
67 
68 } // namespace BIAS
69 
70 #endif // __glfViewport_hh__
int GetWidth() const
Definition: glfViewport.hh:55
int GetHeight() const
Definition: glfViewport.hh:56
virtual ~glfViewport()
Definition: glfViewport.hh:42
class for setting viewports
Definition: glfViewport.hh:37