mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 10:55:57 -04:00
Add utf8 and utf16 cases to the demo
This commit is contained in:
parent
2e2cbbb1e4
commit
635deff498
@ -22,6 +22,8 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include <SDL2/SDL_stdinc.h>
|
||||
|
||||
#include <SDL2pp/SDL.hh>
|
||||
#include <SDL2pp/SDLTTF.hh>
|
||||
#include <SDL2pp/Font.hh>
|
||||
@ -57,6 +59,15 @@ int main() try {
|
||||
font.RenderText_Blended("Hello, world! (blended + outline)", SDL_Color{255, 255, 255, 255})
|
||||
);
|
||||
|
||||
font.SetOutline(0);
|
||||
|
||||
textures.emplace_back(render,
|
||||
font.RenderUTF8_Blended(u8"Hello, world! «¼½¾» (UTF-8 support)", SDL_Color{255, 255, 255, 255})
|
||||
);
|
||||
textures.emplace_back(render,
|
||||
font.RenderUNICODE_Blended(u"Hello, world! «¼½¾» (UTF-16 support)", SDL_Color{255, 255, 255, 255})
|
||||
);
|
||||
|
||||
while (1) {
|
||||
// Process input
|
||||
SDL_Event event;
|
||||
|
Loading…
x
Reference in New Issue
Block a user