zoukankan      html  css  js  c++  java
  • OSG 初始化为非全屏窗口

    OSG默认的窗口时全屏的,调试的时候不方便。

    viewer.setUpViewInWindow(100, 100, 800, 600);

    ----------------------------------------------------------------------------------------

    在网上看到一段代码,也可以非全屏显示

    int _tmain(int argc, _TCHAR* argv[])
    {
     osgViewer::Viewer viewer;
     osg::Node *pNode = osgDB::readNodeFile("glider.osg");
     if (pNode) {
      viewer.setSceneData(pNode);
      viewer.realize();// 必须调用Realize,否则窗口没有创建
      osgViewer::GraphicsWindow *pWnd = dynamic_cast<osgViewer::GraphicsWindow*>(viewer.getCamera()->getGraphicsContext());
      if (pWnd) {
       pWnd->setWindowRectangle(20, 20, 800, 600);

     pWnd->setWindowDecoration(true);
      }
      viewer.run();
     }
     return 0;
    }

  • 相关阅读:
    CSPS模拟 57
    CSPS模拟 56
    CSPS Oct目标
    CSPS模拟 55
    CSPS模拟 54
    CSPS模拟 53
    和manacher有关的乱写
    CSPS模拟 52
    CSPS模拟 51
    Git和代码规范
  • 原文地址:https://www.cnblogs.com/coolbear/p/3532415.html
Copyright © 2011-2022 走看看