|
本帖最后由 小行星 于 2011-8-12 17:34 编辑
- #include <osgWidget/Util>
- #include <osgWidget/WindowManager>
- #include <osgWidget/Canvas>
- const unsigned int MASK_2D = 0xF0000000;
- int main(int argc, char** argv)
- {
- osgViewer::Viewer viewer;
- osgWidget::WindowManager* wm = new osgWidget::WindowManager(
- &viewer,
- 1280.0f,
- 1024.0f,
- MASK_2D,
- osgWidget::WindowManager::WM_PICK_DEBUG
- );
- osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas");
- osgWidget::Label* label = new osgWidget::Label( "label_test", "test" );
- label->setFontColor( 1.0f, 0.0f, 0.0f, 1.0f );
- label->setFontSize( 60 );
- canvas->addWidget( label, 0.0f, 0.0f );
- canvas->resize();
- wm->addChild(canvas);
- return osgWidget::createExample(viewer, wm);
- }
复制代码
在官方示例osgwidgetcanvas.cpp的基础上改的,每次改变窗口大小的时候,Canvas的bg总是会增大……这是个bug吗? |
|