Skip to content

Commit 3e9ebc4

Browse files
committed
Merge pull request #2310 from paroj:ovisup
2 parents ceb6852 + e639c8e commit 3e9ebc4

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

modules/ovis/samples/ovis_demo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@
3131
while cv.ovis.waitKey(1) != 27:
3232
R, t = iwin.getCameraPose()
3333
owin.setEntityPose("cam", t, R)
34+
35+
del iwin # must be destroyed in reverse creation order

modules/ovis/src/ovis.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,20 @@ struct Application : public OgreBites::ApplicationContext, public OgreBites::Inp
238238
return ret;
239239
}
240240

241+
#if OGRE_VERSION < ((1 << 16) | (12 << 8) | 3)
242+
void destroyWindow(const Ogre::String& name)
243+
{
244+
for (auto it = mWindows.begin(); it != mWindows.end(); ++it)
245+
{
246+
if (it->render->getName() != name)
247+
continue;
248+
mRoot->destroyRenderTarget(it->render);
249+
mWindows.erase(it);
250+
return;
251+
}
252+
}
253+
#endif
254+
241255
size_t numWindows() const { return mWindows.size(); }
242256

243257
void locateResources() CV_OVERRIDE
@@ -371,6 +385,10 @@ class WindowSceneImpl : public WindowScene
371385
_app->closeApp();
372386
_app.release();
373387
}
388+
else
389+
{
390+
_app->destroyWindow(title);
391+
}
374392
}
375393

376394
void setBackground(InputArray image) CV_OVERRIDE
@@ -446,6 +464,9 @@ class WindowSceneImpl : public WindowScene
446464
case PF_BYTE_RGBA:
447465
dst_type = CV_8UC4;
448466
break;
467+
#if OGRE_VERSION >= ((1 << 16) | (12 << 8) | 3)
468+
case PF_DEPTH32F:
469+
#endif
449470
case PF_FLOAT32_R:
450471
dst_type = CV_32F;
451472
break;

0 commit comments

Comments
 (0)