ovis: add SCENE_AA flag to allow pixel-exact rendering

pull/1548/head
Pavel Rojtberg 7 years ago
parent 4c1802a70f
commit 9e8997856e
  1. 4
      modules/ovis/include/opencv2/ovis.hpp
  2. 12
      modules/ovis/src/ovis.cpp

@ -26,6 +26,8 @@ enum SceneSettings
SCENE_SHOW_CS_CROSS = 4,
/// @ref WindowScene::getScreenshot returns images as CV_32FC4 instead of CV_8UC3
SCENE_RENDER_FLOAT = 8,
/// Apply anti-aliasing. The first window determines the setting for all windows.
SCENE_AA = 16
};
enum MaterialProperty
@ -180,7 +182,7 @@ CV_EXPORTS_W void addResourceLocation(const String& path);
* @param flags a combination of @ref SceneSettings
*/
CV_EXPORTS_W Ptr<WindowScene> createWindow(const String& title, const Size& size,
int flags = SCENE_INTERACTIVE);
int flags = SCENE_INTERACTIVE | SCENE_AA);
/**
* update all windows and wait for keyboard event

@ -144,10 +144,11 @@ struct Application : public OgreBites::ApplicationContext, public OgreBites::Inp
uint32_t w;
uint32_t h;
int key_pressed;
int flags;
Application(const Ogre::String& _title, const Size& sz)
Application(const Ogre::String& _title, const Size& sz, int _flags)
: OgreBites::ApplicationContext("ovis", false), sceneMgr(NULL), title(_title), w(sz.width),
h(sz.height), key_pressed(-1)
h(sz.height), key_pressed(-1), flags(_flags)
{
logMgr.reset(new LogManager());
logMgr->createLog("ovis.log", true, true, true);
@ -183,7 +184,10 @@ struct Application : public OgreBites::ApplicationContext, public OgreBites::Inp
_h = h;
_name = title;
}
miscParams["FSAA"] = "4";
if (flags & SCENE_AA)
miscParams["FSAA"] = "4";
miscParams["vsync"] = "true";
OgreBites::NativeWindowPair ret =
@ -539,7 +543,7 @@ Ptr<WindowScene> createWindow(const String& title, const Size& size, int flags)
{
if (!_app)
{
_app = makePtr<Application>(title.c_str(), size);
_app = makePtr<Application>(title.c_str(), size, flags);
_app->initApp();
}

Loading…
Cancel
Save