SO3Engine
|
SO3ScreenshotManager.cpp
Go to the documentation of this file.
24 SScreenshotManager::SScreenshotManager(SViewPort* viewport, unsigned int width, unsigned int height, bool withOverlays, bool transparentBackground)
34 mWidthGridSize = (((float)width / (float)mWindowWidth) > (width / mWindowWidth)) ? (width / mWindowWidth) + 1 : (width / mWindowWidth);
35 mHeightGridSize = (((float)height / (float)mWindowHeight) > (height / mWindowHeight)) ? (height / mWindowHeight) + 1 : (height / mWindowHeight);
39 mTempTex = Ogre::TextureManager::getSingleton().createManual(mViewport->GetCamera()->GetName() + "/ScreenShotTex", SO3_INTERNAL_RESOURCE_GROUP, Ogre::TEX_TYPE_2D, mWindowWidth, mWindowHeight, 0, pformat, Ogre::TU_RENDERTARGET, 0, false, 4);
44 mData = new uint8[(mWindowWidth * mWidthGridSize) * (mWindowHeight * mHeightGridSize) * Ogre::PixelUtil::getNumElemBytes(mRT->suggestPixelFormat())];
87 Ogre::ColourValue bgcolor = (mTransparentBackground) ? Ogre::ColourValue(1.0f, 1.0f, 1.0f, 0.0f) : mViewport->GetOgreViewPortPointer()->getBackgroundColour();
102 Ogre::PixelBox sizedImage = Ogre::PixelBox(mDestWidth, mDestHeight, 1, mRT->suggestPixelFormat());
107 finalImage.loadDynamicImage(static_cast<unsigned char*>(sizedImage.data), sizedImage.getWidth(), sizedImage.getHeight(), mRT->suggestPixelFormat());
147 Ogre::Box subBox = Ogre::Box(x * mWindowWidth, y * mWindowHeight, x * mWindowWidth + mWindowWidth, y * mWindowHeight + mWindowHeight);
159 Ogre::PixelBox sizedImage = Ogre::PixelBox(mDestWidth, mDestHeight, 1, mRT->suggestPixelFormat());
~SScreenshotManager()
Definition SO3ScreenshotManager.cpp:48
void MakeScreenshot(std::string filename)
Definition SO3ScreenshotManager.cpp:60
Definition SO3ViewPort.h:56
Ogre::Viewport * GetOgreViewPortPointer()
Definition SO3ViewPort.cpp:98
Definition SO3Window.h:45
void SetStereoMode(const StereoManager::StereoMode &stereoMode)
Definition SO3Window.cpp:1085
Definition SO3DataScol.h:38
Generated by 1.9.8