Changeset 286 in flair-src for trunk/lib/FlairSimulator/src/Gui_impl.cpp
- Timestamp:
- Jan 8, 2019, 10:13:03 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSimulator/src/Gui_impl.cpp
r166 r286 94 94 device->setResizable(false); 95 95 96 // font = device->getGUIEnvironment()->getBuiltInFont();97 96 driver = device->getVideoDriver(); 98 97 smgr = device->getSceneManager(); … … 179 178 int lastFPS = -1; 180 179 int cam_id = 0; 180 ITexture* texture=0; 181 IGUIFont* font =0; 182 183 if (!driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) { 184 self->Warn("rendering to texture is not possible, axis will not be displayed\n"); 185 } else { 186 texture= getGui()->getSceneManager()->getVideoDriver()->addRenderTargetTexture(dimension2d<u32>(128,128)); 187 device->getGUIEnvironment()->addImage(texture,position2d<s32>(0,scene_height-texture->getSize().Height)); 188 font = getGui()->getDevice()->getGUIEnvironment()->getFont((media_path+"/font/simu_axis_font.xml").c_str()); 189 } 181 190 182 191 receiver->SetModel(models.at(0)); … … 242 251 driver->setViewPort(core::rect<s32>(0, 0, scene_width, scene_height)); 243 252 smgr->drawAll(); // commente voir plus bas 244 /* 245 env->drawAll(); 246 if (font) 247 { 248 font->draw(L"This demo shows that Irrlicht is also capable 249 of drawing 2D graphics.", 250 core::rect<s32>(130,10,300,50), 251 video::SColor(255,255,255,255)); 252 } 253 else 254 { 255 printf("err\n"); 256 } 257 device->setWindowCaption(L"toto");*/ 258 253 259 254 if (dbtFile_r == NULL) {// mode normal 260 255 for (size_t i = 0; i < models.size(); i++) { … … 263 258 } 264 259 260 //render to texture for axis if possible 261 if (texture) { 262 cameras.at(cam_id)->renderAxisToTexture(texture); 263 } 264 265 //process update for sensors (cam, us...) 266 //also draws embedded cameras (see SimuCameraGL::UpdateFrom) 265 267 for (size_t i = 0; i < models.size(); i++) { 266 268 models.at(i)->ProcessUpdate(NULL); 267 269 } 268 270 269 271 // on fait ca ici, devrait etre un peu plus haut 270 272 // mais a priori souci avec models.at(i)->pimpl_->CheckCollision(); … … 274 276 driver->setViewPort(core::rect<s32>(0, 0, scene_width, scene_height)); 275 277 smgr->drawAll(); 276 278 279 driver->setViewPort(core::rect<s32>(0, 0, smgr->getVideoDriver()->getScreenSize().Width, smgr->getVideoDriver()->getScreenSize().Height)); 280 if(font) { 281 font->draw(L"VRPN:",rect<s32>(10,scene_height-30,100,50),SColor(128,255,255,255)); 282 font->draw(L"X",rect<s32>(60,scene_height-30,100,50),SColor(255,255,0,0)); 283 font->draw(L"Y",rect<s32>(70,scene_height-30,100,50),SColor(255,0,255,0)); 284 font->draw(L"Z",rect<s32>(80,scene_height-30,100,50),SColor(255,0,0,255)); 285 286 } 287 device->getGUIEnvironment()->drawAll(); 277 288 driver->endScene(); 278 289 279 290 int fps = driver->getFPS(); 280 291
Note:
See TracChangeset
for help on using the changeset viewer.