Changeset 13041 for OpenSceneGraph/trunk/include/osg/Viewport
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/Viewport (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/Viewport
r11808 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 20 20 namespace osg { 21 21 22 /** Encapsulate OpenGL glViewport. */ 22 /** Encapsulate OpenGL glViewport. */ 23 23 class OSG_EXPORT Viewport : public StateAttribute 24 24 { … … 31 31 #endif 32 32 Viewport(); 33 33 34 34 Viewport(value_type x,value_type y,value_type width,value_type height): 35 35 _x(x), … … 37 37 _width(width), 38 38 _height(height) {} 39 39 40 40 41 41 /** Copy constructor using CopyOp to manage deep vs shallow copy. */ … … 48 48 49 49 META_StateAttribute(osg, Viewport,VIEWPORT); 50 50 51 51 /** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */ 52 52 virtual int compare(const StateAttribute& sa) const … … 61 61 COMPARE_StateAttribute_Parameter(_width) 62 62 COMPARE_StateAttribute_Parameter(_height) 63 63 64 64 return 0; // passed all the above comparison macros, must be equal. 65 65 } … … 73 73 } 74 74 75 #if 0 75 #if 0 76 76 void getViewport(int& x,int& y,int& width,int& height) const 77 77 { … … 108 108 */ 109 109 inline double aspectRatio() const { if (_height!=0) return (double)_width/(double)_height; else return 1.0; } 110 110 111 111 /** Compute the Window Matrix which takes projected coords into Window coordinates. 112 112 * To convert local coordinates into window coordinates use v_window = v_local * MVPW matrix, … … 123 123 124 124 protected: 125 125 126 126 virtual ~Viewport(); 127 127
