Add utf8 and utf16 cases to the demo

This commit is contained in:
Dmitry Marakasov 2015-05-14 17:50:37 +03:00
parent 2e2cbbb1e4
commit 635deff498

View File

@ -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;