Changeset 8079 for code/trunk/src/modules/designtools/ScreenshotManager.h
- Timestamp:
- Mar 15, 2011, 9:47:11 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/designtools/ScreenshotManager.h
r7163 r8079 20 20 { 21 21 22 23 /* Class encapsulates Screenshot functionality and provides a method for making multi grid screenshots. 24 * pRenderWindow: Pointer to the render window. This could be "mWindow" from the ExampleApplication, 25 * the window automatically created obtained when calling 26 * Ogre::Root::getSingletonPtr()->initialise(false) and retrieved by calling 27 * "Ogre::Root::getSingletonPtr()->getAutoCreatedWindow()", or the manually created 28 * window from calling "mRoot->createRenderWindow()". 29 * gridSize: The magnification factor. A 2 will create a 2x2 grid, doubling the size of the 30 screenshot. A 3 will create a 3x3 grid, tripling the size of the screenshot. 31 * fileExtension: The extension of the screenshot file name, hence the type of graphics file to generate. 32 * To generate "MyScreenshot.png" this parameter would contain ".png". 22 /** 23 @brief 24 Class encapsulates Screenshot functionality and provides a method for making multi grid screenshots. 33 25 */ 34 26 class ScreenshotManager : public OrxonoxClass, public Singleton<ScreenshotManager> … … 36 28 friend class Singleton<ScreenshotManager>; 37 29 38 public:39 ScreenshotManager();40 ~ScreenshotManager();30 public: 31 ScreenshotManager(); 32 virtual ~ScreenshotManager(); 41 33 42 /* Creates a screenshot with the given camera. 43 * @param camera Pointer to the camera "looking at" the scene of interest 44 * @param fileName the filename of the screenshot file. 45 */ 46 void makeScreenshot() const; 34 void makeScreenshot() const; //!< Creates a screenshot with the given camera. 47 35 48 static void makeScreenshot_s() 49 { getInstance().makeScreenshot(); } 36 /** 37 @brief Creates a screenshot with a given size. 38 @param size Size is factor by which the current screen size is scaled. 39 */ 40 static void makeScreenshot_s(unsigned int size) 41 { getInstance().setGridSize(size); getInstance().makeScreenshot(); } 50 42 51 protected: 52 static std::string getTimestamp(); 43 void setGridSize(unsigned int size); //!< Set the size of the grid. 53 44 54 std::string mFileExtension; 55 unsigned int mGridSize, mWindowWidth, mWindowHeight; 56 bool mDisableOverlays; 57 //temp texture with current screensize 58 Ogre::TexturePtr mTempTex; 59 Ogre::RenderTexture* mRT; 60 Ogre::HardwarePixelBufferSharedPtr mBuffer; 61 //PixelBox for a large Screenshot, if grid size is > 1 62 Ogre::PixelBox mFinalPicturePB; 63 uint8_t* data_; 45 protected: 46 static std::string getTimestamp(); 64 47 65 static ScreenshotManager* singletonPtr_s; 48 std::string mFileExtension_; 49 unsigned int mGridSize_; //!< The magnification factor. A 2 will create a 2x2 grid, doubling the size of the screenshot. A 3 will create a 3x3 grid, tripling the size of the screenshot. 50 unsigned int mWindowWidth_, mWindowHeight_; 51 bool mDisableOverlays_; 52 //! temp texture with current screensize 53 Ogre::TexturePtr mTempTex_; 54 Ogre::RenderTexture* mRT_; 55 Ogre::HardwarePixelBufferSharedPtr mBuffer_; 56 //! PixelBox for a large Screenshot, if grid size is > 1 57 Ogre::PixelBox mFinalPicturePB_; 58 uint8_t* data_; 59 60 static ScreenshotManager* singletonPtr_s; 66 61 }; 67 62
Note: See TracChangeset
for help on using the changeset viewer.