|
|
|
@ -289,7 +289,7 @@ class WindowSceneImpl : public WindowScene |
|
|
|
|
Root* root; |
|
|
|
|
SceneManager* sceneMgr; |
|
|
|
|
SceneNode* camNode; |
|
|
|
|
RenderWindow* rWin; |
|
|
|
|
RenderTarget* rWin; |
|
|
|
|
Ptr<OgreBites::CameraMan> camman; |
|
|
|
|
Ptr<Rectangle2D> bgplane; |
|
|
|
|
std::unordered_map<AnimationState*, Controller<Real>*> frameCtrlrs; |
|
|
|
@ -344,11 +344,22 @@ public: |
|
|
|
|
|
|
|
|
|
if (!app->sceneMgr) |
|
|
|
|
{ |
|
|
|
|
CV_Assert((flags & SCENE_OFFSCREEN) == 0 && "off-screen rendering for main window not supported"); |
|
|
|
|
|
|
|
|
|
app->sceneMgr = sceneMgr; |
|
|
|
|
rWin = app->getRenderWindow(); |
|
|
|
|
if (camman) |
|
|
|
|
app->addInputListener(camman.get()); |
|
|
|
|
} |
|
|
|
|
else if (flags & SCENE_OFFSCREEN) |
|
|
|
|
{ |
|
|
|
|
// render into an offscreen texture
|
|
|
|
|
TexturePtr tex = TextureManager::getSingleton().createManual( |
|
|
|
|
title, RESOURCEGROUP_NAME, TEX_TYPE_2D, sz.width, sz.height, 0, PF_BYTE_RGB, |
|
|
|
|
TU_RENDERTARGET, NULL, false, flags & SCENE_AA ? 4 : 0); |
|
|
|
|
rWin = tex->getBuffer()->getRenderTarget(); |
|
|
|
|
rWin->setAutoUpdated(false); // only update when requested
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
OgreBites::NativeWindowPair nwin = app->createWindow(title, sz.width, sz.height); |
|
|
|
@ -820,6 +831,11 @@ public: |
|
|
|
|
ndc = (2 * f * n) / ndc; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void update() |
|
|
|
|
{ |
|
|
|
|
rWin->update(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void fixCameraYawAxis(bool useFixed, InputArray _up) CV_OVERRIDE |
|
|
|
|
{ |
|
|
|
|
#if OGRE_VERSION >= ((1 << 16) | (11 << 8) | 5) |
|
|
|
@ -923,6 +939,7 @@ public: |
|
|
|
|
|
|
|
|
|
CV_EXPORTS_W void addResourceLocation(const String& path) |
|
|
|
|
{ |
|
|
|
|
CV_Assert(!_app && "must be called before the first createWindow"); |
|
|
|
|
_extraResourceLocations.insert(Ogre::StringUtil::normalizeFilePath(path, false)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|