Project

General

Profile

SO3Engine
SO3ScreenshotManager.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2017 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
31#ifndef __SO3SCREENSHOTMANAGER_H__
32#define __SO3SCREENSHOTMANAGER_H__
33
37
38namespace SO3
39{
40
42{
43public:
44protected:
45private:
46 unsigned int mWidthGridSize;
47 unsigned int mHeightGridSize;
48 unsigned int mWindowWidth;
49 unsigned int mWindowHeight;
50 unsigned int mDestWidth;
51 unsigned int mDestHeight;
52 bool mEnableOverlays;
53 bool mTransparentBackground;
54
55 //temp texture with current screensize
56 Ogre::TexturePtr mTempTex;
57 Ogre::RenderTexture* mRT;
58 Ogre::HardwarePixelBufferSharedPtr mBuffer;
59 //PixelBox for a large Screenshot, if grid size is > 1
60 Ogre::PixelBox mFinalPicturePB;
61 //Pointer to the color data of the pixel box
62 Ogre::uint8* mData;
63 SViewPort* mViewport;
64
65public:
69 SScreenshotManager(SViewPort* viewport, unsigned int width, unsigned int height, bool withOverlays, bool transparentBackground);
70
75
76 void MakeScreenshot(std::string filename);
77private:
82};
83
84}
85
86#endif
librairies include
void MakeScreenshot(std::string filename)