|
发表于 2009-2-17 13:25:49
|
显示全部楼层
你在国外应该也是可以邮寄的,,,如果你真的想邮购《OSG编程入门指南》,,我可以向快递公司帮你查一下邮购的费用,,,这个就要另行计费了~~~~~
相关的代码:- void cOSG::InitCameraConfig(void)
- {
- // Local Variable to hold window size data
- RECT rect;
- // Create the viewer for this window
- mViewer = new osgViewer::Viewer();
- // Add a Stats Handler to the viewer
- mViewer->addEventHandler(new osgViewer::StatsHandler);
-
- // Get the current window size
- ::GetWindowRect(m_hWnd, &rect);
- // Init the GraphicsContext Traits
- osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
- // Init the Windata Variable that holds the handle for the Window to display OSG in.
- osg::ref_ptr<osg::Referenced> windata = new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);
- // Setup the traits parameters
- traits->x = 0;
- traits->y = 0;
- traits->width = rect.right - rect.left;
- traits->height = rect.bottom - rect.top;
- traits->windowDecoration = false;
- traits->doubleBuffer = true;
- traits->sharedContext = 0;
- traits->setInheritedWindowPixelFormat = true;
- traits->inheritedWindowData = windata;
- // Create the Graphics Context
- osg::GraphicsContext* gc = osg::GraphicsContext::createGraphicsContext(traits.get());
- // Init a new Camera (Master for this View)
- osg::ref_ptr<osg::Camera> camera = new osg::Camera;
- // Assign Graphics Context to the Camera
- camera->setGraphicsContext(gc);
- // Set the viewport for the Camera
- camera->setViewport(new osg::Viewport(traits->x, traits->y, traits->width, traits->height));
- // Add the Camera to the Viewer
- mViewer->addSlave(camera.get());
- // Add the Camera Manipulator to the Viewer
- mViewer->setCameraManipulator(keyswitchManipulator.get());
- // Set the Scene Data
- mViewer->setSceneData(mRoot.get());
- // Realize the Viewer
- mViewer->realize();
- }
复制代码 |
|