Fission FSN
Loading...
Searching...
No Matches
fsCAxmolRenderTexture.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsCAxmolRenderTexture.h
4*
5* Purpose: axmol derived class for render texture
6* access to save to non-writable location
7* Defined for debug use to create level
8* thumbnails
9*
10*/
11
12#ifndef fsCAxmolRenderTexturehdr
13#define fsCAxmolRenderTexturehdr
14
15namespace ax
16{
17 class Sprite;
18 class Texture2D;
19}
20
21#include <fsCore/fsPoint.h>
22
23#ifdef AXMOL_V3
24 #include <renderer/RenderTexture.h>
25#else
26 #include <2d/RenderTexture.h>
27#endif
28
29class fsRect;
30
31class fsCAxmolRenderTexture : public ax::RenderTexture
32{
33 public:
34
35 bool saveToFileAsJPG(std::string_view filename);
36
37
38 void partialEnd();
39 void partialBegin();
40
41 void saveToFileWithResize(const std::string_view filename, const std::string_view mask_filename, SaveFileCallbackType callback = nullptr);
42 void saveRegionToFile(const std::string_view filename, const fsRect& pCaptureRect, const fsPoint& pOutputDimensions, SaveFileCallbackType callback = nullptr);
43
44#ifdef AXMOL_V3
45 static fsCAxmolRenderTexture* create(int w, int h, ax::PixelFormat format, ax::PixelFormat depthStencilFormat, bool sharedRenderTarget);
46 static fsCAxmolRenderTexture* create(int w, int h, ax::PixelFormat format, bool sharedRenderTarget);
47#else
48 static fsCAxmolRenderTexture* create(int w, int h, ax::backend::PixelFormat format, ax::backend::PixelFormat depthStencilFormat, bool sharedRenderTarget);
49 static fsCAxmolRenderTexture* create(int w, int h, ax::backend::PixelFormat format, bool sharedRenderTarget);
50#endif
51
52 static fsCAxmolRenderTexture* create(int w, int h, bool sharedRenderTarget);
53
54 protected:
55
56 private:
57
58 void onSaveToFileWithResize(const std::string_view filename, const std::string_view mask_filename);
59 void onSaveRegionToFile(const std::string_view filename, const fsRect& pCaptureRect, const fsPoint& pOutputDimensions);
60 void onPartialEnd();
61 void onPartialBegin();
62
63};
64
65
66#endif
Definition fsCAxmolRenderTexture.h:32
void saveToFileWithResize(const std::string_view filename, const std::string_view mask_filename, SaveFileCallbackType callback=nullptr)
Definition fsCAxmolRenderTexture.cpp:161
void partialEnd()
Definition fsCAxmolRenderTexture.cpp:115
bool saveToFileAsJPG(std::string_view filename)
Definition fsCAxmolRenderTexture.cpp:147
void partialBegin()
Definition fsCAxmolRenderTexture.cpp:19
void saveRegionToFile(const std::string_view filename, const fsRect &pCaptureRect, const fsPoint &pOutputDimensions, SaveFileCallbackType callback=nullptr)
Definition fsCAxmolRenderTexture.cpp:273
static fsCAxmolRenderTexture * create(int w, int h, ax::backend::PixelFormat format, ax::backend::PixelFormat depthStencilFormat, bool sharedRenderTarget)
Definition fsCAxmolRenderTexture.cpp:390
Definition fsRect.h:16
Definition fsC3dLight.h:19
Definition fsPoint.h:17