• osgViewer::Viewer::Windows


    osg自带窗口去掉边框

    #ifdef _WIN32
    #include <Windows.h>
    #endif // _WIN32
    #include<iostream>
    
    #include <osgViewer/Viewer>
    #include <osgViewer/ViewerEventHandlers> 
    #include <osgViewer/CompositeViewer> 
    #include <osgDB/ReadFile>
    #include <osg/Geode>
    #include <osg/Node>
    #include <osg/Geometry>
    #include <osgGA/TrackballManipulator>
    #include <osg/GraphicsContext>
    #include <osg/ShapeDrawable>
    #include <osg/Material>
    #include <osg/Image>
    #include <osg/Texture2D>
    #include <osg/TexEnv>
    #include <osg/TexGen>
    #include <osg/MatrixTransform>
    #include <osg/PositionAttitudeTransform>
    #include <osg/AnimationPath>
    #include <osg/Matrixd>
    
    #include <osgGA/GUIEventHandler>
    #include <osgGA/CameraManipulator>
    #include <osgGA/StandardManipulator>
    #include <osgGA/OrbitManipulator>
    #include <osgGA/TrackballManipulator>
    #include <osgUtil/IntersectionVisitor>
    #include <osgUtil/LineSegmentIntersector>
    
    int main()
    {
        osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer;
        osg::ref_ptr<osg::Node> node1;
        osg::GraphicsContext::WindowingSystemInterface *ws = osg::GraphicsContext::getWindowingSystemInterface();
        
        unsigned int height=0, width=0;
        osg::GraphicsContext::Traits traits;
        osg::GraphicsContext::ScreenIdentifier screenIdentifier1;
        
        if (ws)
        {
            ws->getScreenResolution(screenIdentifier1, width, height);
            std::cout << "ws is not null" << std::endl;
            std::cout << "resolution:  w:"<<width<<"  h:"<<height<<"  " << std::endl;
            std::cout << "border:"<<screenIdentifier1.displayNum << std::endl;
    
        }
        else
        {
            std::cout << "ws is null" << std::endl;
        }
    
        node1 = osgDB::readNodeFile("D:\参考手册\BIM\osg\build1.OSGB");
        viewer->setSceneData(node1.get());
        viewer->setUpViewInWindow(200, 200, 800, 500, 0);
        
        osgViewer::Viewer::Windows win1;
        osgViewer::Viewer::Windows::iterator iter1;
    
        viewer->getWindows(win1);
        if (!win1.empty())
        {
            for (iter1=win1.begin();iter1 != win1.end(); ++iter1)
            {
                (*iter1)->setWindowDecoration(false);
            }
        }
    
        return viewer->run();
    }

  • 相关阅读:
    html 带渐变的吸顶效果 vue
    Linux添加环境变量
    C#集合通论
    Android adb 命令导出数据库
    查看签名方式及签名信息
    啥 啥 啥,服务治理是个啥
    令牌桶、漏斗、冷启动限流在sentinel的应用
    MySQL事务
    MySQL优化
    MySQL视图、存储过程、函数、触发器
  • 原文地址:https://www.cnblogs.com/herd/p/11095138.html
Copyright © 2020-2023  润新知