zoukankan      html  css  js  c++  java
  • 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();
    }

  • 相关阅读:
    Filter的基本配置
    11.3、4(filter的生命周期和API)、
    11.1(过滤器概述)、(创建过滤器filter)
    10.6商品的促销活动,(未解决)
    php 调用常量或者变量的时候千万不能加引号""'' 不然不生效
    thinkphp5 if else的表达式怎么写?
    request() 获取参数是数组不是对象
    thinkphp5 PATHINFO路由正确的访问方式
    thinkphp5 的iframe文件怎么显示到html里面
    thinkphp5引入外部css js文件
  • 原文地址:https://www.cnblogs.com/herd/p/11095138.html
Copyright © 2011-2022 走看看