guiOffscreenCanvas.h 1.3 KB

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