Plutonium framework API  0.1
Simple UI framework for libnx and SDL2
Renderer.hpp
Go to the documentation of this file.
1 
2 /*
3 
4  Plutonium library
5 
6  @file Renderer.hpp
7  @brief A Renderer is the object performing basic rendering. (simply, a SDL2 wrapper)
8  @author XorTroll
9 
10  @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
11 
12 */
13 
14 #pragma once
15 #include <pu/draw.hpp>
16 #include <pu/render/SDL2.hpp>
17 #include <string>
18 #include <fstream>
19 
20 namespace pu::render
21 {
22  class Renderer
23  {
24  public:
25  void Initialize();
26  void Finalize();
27  bool HasInitialized();
28  bool HasRomFs();
29  void InitializeRender(draw::Color Color);
30  void FinalizeRender();
31  void RenderTexture(NativeTexture Texture, u32 X, u32 Y, int AlphaMod = -1);
32  void RenderTextureScaled(NativeTexture Texture, u32 X, u32 Y, u32 Width, u32 Height, int AlphaMod = -1);
33  void RenderRectangle(draw::Color Color, u32 X, u32 Y, u32 Width, u32 Height);
34  void RenderRectangleFill(draw::Color Color, u32 X, u32 Y, u32 Width, u32 Height);
35  void RenderRoundedRectangle(draw::Color Color, u32 X, u32 Y, u32 Width, u32 Height, u32 Radius);
36  void RenderRoundedRectangleFill(draw::Color Color, u32 X, u32 Y, u32 Width, u32 Height, u32 Radius);
37  void RenderCircle(draw::Color Color, u32 X, u32 Y, u32 Radius);
38  void RenderCircleFill(draw::Color Color, u32 X, u32 Y, u32 Radius);
39  void RenderShadowSimple(u32 X, u32 Y, u32 Width, u32 Height, u32 BaseAlpha, u8 MainAlpha = 255);
40  private:
41  bool okromfs;
42  bool initialized;
43  NativeWindow rendwd;
44  NativeSurface rendsf;
45  };
46 
48 }
void InitializeRender(draw::Color Color)
void RenderRoundedRectangle(draw::Color Color, u32 X, u32 Y, u32 Width, u32 Height, u32 Radius)
NativeRenderer GetMainRenderer()
Definition: Renderer.hpp:22
Definition: Renderer.hpp:20
void RenderRoundedRectangleFill(draw::Color Color, u32 X, u32 Y, u32 Width, u32 Height, u32 Radius)
void RenderCircleFill(draw::Color Color, u32 X, u32 Y, u32 Radius)
void RenderCircle(draw::Color Color, u32 X, u32 Y, u32 Radius)
void RenderTexture(NativeTexture Texture, u32 X, u32 Y, int AlphaMod=-1)
SDL_Renderer * NativeRenderer
Definition: SDL2.hpp:14
void RenderRectangleFill(draw::Color Color, u32 X, u32 Y, u32 Width, u32 Height)
void RenderShadowSimple(u32 X, u32 Y, u32 Width, u32 Height, u32 BaseAlpha, u8 MainAlpha=255)
SDL_Texture * NativeTexture
Definition: SDL2.hpp:16
void RenderRectangle(draw::Color Color, u32 X, u32 Y, u32 Width, u32 Height)
SDL_Window * NativeWindow
Definition: SDL2.hpp:13
void RenderTextureScaled(NativeTexture Texture, u32 X, u32 Y, u32 Width, u32 Height, int AlphaMod=-1)
Definition: Color.hpp:19
SDL_Surface * NativeSurface
Definition: SDL2.hpp:15