1 #include <osg/Scissor>
2 #include <osgDB/ObjectWrapper>
3 #include <osgDB/InputStream>
4 #include <osgDB/OutputStream>
5 
checkArea(const osg::Scissor & attr)6 static bool checkArea( const osg::Scissor& attr )
7 {
8     return true;
9 }
10 
readArea(osgDB::InputStream & is,osg::Scissor & attr)11 static bool readArea( osgDB::InputStream& is, osg::Scissor& attr )
12 {
13     int x, y, w, h;
14     is >> x >> y >> w >> h;
15     attr.setScissor( x, y, w, h );
16     return true;
17 }
18 
writeArea(osgDB::OutputStream & os,const osg::Scissor & attr)19 static bool writeArea( osgDB::OutputStream& os, const osg::Scissor& attr )
20 {
21     os << attr.x() << attr.y() << attr.width() << attr.height() << std::endl;
22     return true;
23 }
24 
25 REGISTER_OBJECT_WRAPPER( Scissor,
26                          new osg::Scissor,
27                          osg::Scissor,
28                          "osg::Object osg::StateAttribute osg::Scissor" )
29 {
30     ADD_USER_SERIALIZER( Area );  // _x, _y, _width, _height
31 }
32