Torque3D Documentation / _generateds / guiOffscreenCanvas.h

guiOffscreenCanvas.h

Engine/source/gui/core/guiOffscreenCanvas.h

More...

Classes:

Detailed Description

 1
 2#ifndef _GUIOFFSCREENCANVAS_H_
 3#define _GUIOFFSCREENCANVAS_H_
 4
 5#include "math/mMath.h"
 6#include "gui/core/guiCanvas.h"
 7#include "core/util/tVector.h"
 8
 9#ifndef _MATTEXTURETARGET_H_
10#include "materials/matTextureTarget.h"
11#endif
12
13class GuiTextureDebug;
14
15class GuiOffscreenCanvas : public GuiCanvas
16{
17public:
18   typedef GuiCanvas Parent;
19   
20   GuiOffscreenCanvas();
21   ~GuiOffscreenCanvas();
22   
23   bool onAdd();
24   void onRemove();
25   
26   void renderFrame(bool preRenderOnly, bool bufferSwap);
27   virtual void onFrameRendered();
28   
29   Point2I getWindowSize();
30
31   Point2I getCursorPos();
32   void setCursorPos(const Point2I &pt);
33   void showCursor(bool state);
34   bool isCursorShown();
35   
36   void _onTextureEvent( GFXTexCallbackCode code );
37
38   void _setupTargets();
39   void _teardownTargets();
40
41   NamedTexTargetRef getTarget() { return &mNamedTarget; }
42
43   void markDirty() { mTargetDirty = true; }
44
45   static void initPersistFields();
46   
47   DECLARE_CONOBJECT(GuiOffscreenCanvas);
48
49protected:
50   GFXTextureTargetRef mTarget;
51   NamedTexTarget mNamedTarget;
52   GFXTexHandle mTargetTexture;
53
54   GFXFormat mTargetFormat;
55   Point2I mTargetSize;
56   String mTargetName;
57
58   bool mTargetDirty;
59   bool mDynamicTarget;
60   
61   bool mUseDepth;
62   GFXTexHandle mTargetDepth;
63
64public:
65   static Vector<GuiOffscreenCanvas*> sList;
66};
67
68#endif
69