osgViewer::Viewer::Windows
2024-09-01 13:25:15
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=, width=;
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(, , , , ); 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();
}
最新文章
- XMl.02-约束
- Altium Designer 15 --- Design PCB Frame by Rhinoceros
- hdu4950 Monster (水题)
- andorid lint
- C++ Unicode SBCS 函数对照表
- java 地址记录
- 在virtualenv中安装libxml2和libxslt
- DICOM医学图像处理:DCMTK在VS2012中的配置
- 当页面加载完成时,JQ触发添加页面的元素的事件触发不了。。
- Spark2.1集群安装(standalone模式)
- 转深入Java虚拟机 之四:类加载机制
- 【转载】Win7利用任务计划程序实现定时关机
- Java_并发工具包 java.util.concurrent 用户指南(转)
- Python __dict__属性详解
- P1080 国王游戏 贪心 高精度
- String()与toString的区别
- 设置nginx和php-fpm更改上传文件大小限制
- 使用InstallAnywhere7.1制作Java exe程序安装包
- iOS项目之“返回”手势操作相关
- sqlite 判断表中是否包含 某个字段