Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 31, 2010, 1:30:58 PM (14 years ago)
Author:
rgrieder
Message:

ScreenshotManager working now, though there might be a memory leak in the destructor.
The command is "printScreenHD".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/modules/designtools/ScreenshotManager.h

    r7039 r7041  
    44#define __ScreenshotManager_h__
    55
     6#include "DesignToolsPrereqs.h"
     7
    68#include <string>
     9#include <cstring>
     10#include <cstdlib>
     11
    712#include <OgrePrerequisites.h>
    813#include <OgreTexture.h>
    914#include <OgreHardwarePixelBuffer.h>
    10 #include "OrxonoxConfig.h"
    11 #include <cstring>
    12 #include <cstdlib>
     15
     16#include "util/Singleton.h"
     17#include "core/OrxonoxClass.h"
    1318
    1419namespace orxonox
     
    2732    *              To generate "MyScreenshot.png" this parameter would contain ".png".
    2833    */
    29     class ScreenshotManager
     34    class ScreenshotManager : public OrxonoxClass, public Singleton<ScreenshotManager>
    3035    {
     36        friend class Singleton<ScreenshotManager>;
     37
    3138    public:
    32         ScreenshotManager(Ogre::RenderWindow* pRenderWindow, int gridSize, std::string fileExtension, bool overlayFlag);
     39        ScreenshotManager();
    3340        ~ScreenshotManager();
    3441
     
    3744        * @param fileName the filename of the screenshot file.
    3845      */
    39         void makeScreenshot(Ogre::Camera* camera, Ogre::String fileName) const;
     46        void makeScreenshot() const;
     47
     48        static void makeScreenshot_s()
     49            { getInstance().makeScreenshot(); }
    4050     
    4151    protected:
     52        static std::string ScreenshotManager::getTimestamp();
     53
    4254        std::string    mFileExtension;
    4355        unsigned int   mGridSize, mWindowWidth, mWindowHeight;
     
    5062        Ogre::PixelBox  mFinalPicturePB;
    5163        uint8_t* data_;
     64
     65        static ScreenshotManager* singletonPtr_s;
    5266    };
    5367
Note: See TracChangeset for help on using the changeset viewer.