| 32 | } |
| 33 | |
| 34 | void DemoKeeper::createScene() |
| 35 | { |
| 36 | base::BaseDemoManager::createScene(); |
| 37 | createDefaultScene(); |
| 38 | const MyGUI::VectorWidgetPtr& root = MyGUI::LayoutManager::getInstance().loadLayout("HelpPanel.layout"); |
| 39 | if (root.size() == 1) |
| 40 | root.at(0)->findWidget("Text")->castType<MyGUI::TextBox>()->setCaption( |
| 41 | "Demo of rendering camera view into widget and mesh into widget (you can drag it using mouse)."); |
| 42 | |
| 43 | const MyGUI::IntSize& size = MyGUI::RenderManager::getInstance().getViewSize(); |
| 44 | |
| 45 | MyGUI::Window* window = MyGUI::Gui::getInstance().createWidget<MyGUI::Window>( |
| 46 | "WindowCS", |
| 47 | MyGUI::IntCoord(10, size.height - 10 - 230, 300, 230), |
| 48 | MyGUI::Align::Default, |
| 49 | "Overlapped"); |
| 50 | window->setCaption("Camera view"); |
| 51 | window->setMinSize(MyGUI::IntSize(100, 100)); |
| 52 | |
| 53 | MyGUI::Window* window2 = MyGUI::Gui::getInstance().createWidget<MyGUI::Window>( |
| 54 | "WindowCS", |
| 55 | MyGUI::IntCoord(size.width - 10 - 300, 10, 300, 230), |
| 56 | MyGUI::Align::Default, |
| 57 | "Overlapped"); |
| 58 | window2->setCaption("Model view"); |
| 59 | window2->setMinSize(MyGUI::IntSize(100, 100)); |
| 60 | MyGUI::Canvas* canvas2 = window2->createWidget<MyGUI::Canvas>( |
| 61 | "Canvas", |
| 62 | MyGUI::IntCoord(0, 0, window2->getClientCoord().width, window2->getClientCoord().height), |
| 63 | MyGUI::Align::Stretch); |
| 64 | canvas2->setPointer("hand"); |
| 65 | |
| 66 | #ifdef MYGUI_OGRE_PLATFORM |
| 67 | MyGUI::Canvas* canvas = window->createWidget<MyGUI::Canvas>( |
| 68 | "Canvas", |
| 69 | MyGUI::IntCoord(0, 0, window->getClientCoord().width, window->getClientCoord().height), |
| 70 | MyGUI::Align::Stretch); |
| 71 | |
| 72 | gRenderBox.setCanvas(canvas); |
| 73 | gRenderBox.setViewport(getCamera()); |
| 74 | gRenderBox.setBackgroundColour(MyGUI::Colour::Black); |
| 75 | |
| 76 | gRenderBoxScene.setCanvas(canvas2); |
| 77 | gRenderBoxScene.injectObject("Robot.mesh"); |
| 78 | gRenderBoxScene.setAutoRotation(true); |
| 79 | gRenderBoxScene.setMouseRotation(true); |
| 80 | #endif // MYGUI_OGRE_PLATFORM |
| 81 | |
| 82 | MyGUI::Gui::getInstance().eventFrameStart += MyGUI::newDelegate(this, &DemoKeeper::notifyFrameStart); |
| 83 | } |
| 84 | |
| 85 | void DemoKeeper::destroyScene() |
| 86 | { |
nothing calls this directly
no test coverage detected