TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tb_render_target.hpp
1 
11 #ifndef TurtleBrains_RenderTarget_hpp
12 #define TurtleBrains_RenderTarget_hpp
13 
14 #include <turtle_brains/graphics/tb_texture_manager.hpp> //For PixelSpace and TextureHandle types.
15 
16 #include <memory>
17 
18 namespace tbImplementation { struct RenderTargetData; }
19 
20 namespace TurtleBrains
21 {
22  namespace Graphics
23  {
24  enum class TargetType {
25  Color,
26  Depth,
27  ColorAndDepth,
28  };
29 
35  {
36  public:
40  static void CreateGraphicsContext(void);
41  static void DestroyGraphicsContext(void);
42 
47  explicit RenderTarget(const PixelSpace& targetWidth, const PixelSpace& targetHeight, const TargetType& targetType = TargetType::Color);
48 
52  ~RenderTarget(void);
53 
62  void BindRenderTarget(void) const;
63 
69  void UnbindRenderTarget(void) const;
70 
82  void ManagePixelData(const bool managePixelData);
83 
92  void SetMipmap(bool doMipmaps);
93 
101  bool IsTextureValid(void) const;
102 
110 
117 
121  PixelSpace GetWidth(void) const;
122 
126  PixelSpace GetHeight(void) const;
127 
131  float GetAspectRatio(void) const;
132 
133  private:
134  std::unique_ptr<tbImplementation::RenderTargetData> mData;
135  };
136 
137  }; /* namespace Graphics */
138 }; /* namespace TurtleBrains */
139 
141 
142 #endif /* TurtleBrains_RenderTarget_hpp */
Give the GameScene and Entities something to display, Text, Sprites and AnimatedSprites help bring th...
Definition: tb_render_target.hpp:34
Definition: tb_noncopyable.hpp:22
tbGraphics::TextureHandle GetDepthTextureHandle(void) const
Here is some information about the primary namespace.
Definition: tb_application_dialog.hpp:21
tbCore::uint16 PixelSpace
Definition: tb_texture_manager.hpp:36
void ManagePixelData(const bool managePixelData)
RenderTarget(const PixelSpace &targetWidth, const PixelSpace &targetHeight, const TargetType &targetType=TargetType::Color)
PixelSpace GetHeight(void) const
PixelSpace GetWidth(void) const
Definition: tb_application_dialog.hpp:19
tbGraphics::TextureHandle GetTextureHandle(void) const