Plutonium framework API  0.1
Simple UI framework for libnx and SDL2
SDL2.hpp
Go to the documentation of this file.
1 
2 #pragma once
3 #include <string>
4 #include <switch.h>
5 #include <pu/draw.hpp>
6 #include <SDL2/SDL.h>
7 #include <SDL2/SDL_image.h>
8 #include <SDL2/SDL_ttf.h>
9 #include <SDL2/SDL2_gfxPrimitives.h>
10 
11 namespace pu::render
12 {
13  typedef SDL_Window *NativeWindow;
14  typedef SDL_Renderer *NativeRenderer;
15  typedef SDL_Surface *NativeSurface;
16  typedef SDL_Texture *NativeTexture;
17  typedef TTF_Font *NativeFont;
18 
19  enum class SharedFont
20  {
21  Standard,
25  Korean,
27  };
28 
30  NativeTexture RenderText(NativeFont Font, std::string Text, draw::Color Color);
31  NativeTexture LoadImage(std::string Path);
32  NativeFont LoadSharedFont(SharedFont Type, u32 Size);
33  NativeFont LoadFont(std::string Path, u32 Size);
34  u32 GetTextureWidth(NativeTexture Texture);
35  u32 GetTextureHeight(NativeTexture Texture);
36  u32 GetTextWidth(NativeFont Font, std::string Text);
37  u32 GetTextHeight(NativeFont Font, std::string Text);
38  void SetAlphaValue(NativeTexture Texture, u8 Alpha);
40  void DeleteTexture(NativeTexture Texture);
41 }
u32 GetTextWidth(NativeFont Font, std::string Text)
u32 GetTextureHeight(NativeTexture Texture)
u32 GetTextureWidth(NativeTexture Texture)
SharedFont
Definition: SDL2.hpp:19
Font
Definition: Font.hpp:18
NativeFont LoadSharedFont(SharedFont Type, u32 Size)
Definition: Renderer.hpp:20
TTF_Font * NativeFont
Definition: SDL2.hpp:17
NativeFont LoadFont(std::string Path, u32 Size)
NativeTexture RenderText(NativeFont Font, std::string Text, draw::Color Color)
u32 GetTextHeight(NativeFont Font, std::string Text)
NativeTexture ConvertToTexture(NativeSurface Surface)
SDL_Renderer * NativeRenderer
Definition: SDL2.hpp:14
NativeTexture LoadImage(std::string Path)
void DeleteTexture(NativeTexture Texture)
void SetAlphaValue(NativeTexture Texture, u8 Alpha)
SDL_Texture * NativeTexture
Definition: SDL2.hpp:16
SDL_Window * NativeWindow
Definition: SDL2.hpp:13
Definition: Color.hpp:19
void DeleteFont(NativeFont Font)
SDL_Surface * NativeSurface
Definition: SDL2.hpp:15