From 2869db24ef8c1715da14779da646c6aee7e12d36 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Wed, 21 Jan 2015 23:15:18 +0300 Subject: [PATCH] Remove unneeded parentheses, fix README example --- README.md | 6 +++--- examples/ttf.cc | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a2c883a..c746f29 100644 --- a/README.md +++ b/README.md @@ -26,11 +26,11 @@ This library provides C++11 bindings/wrapper for SDL2 and satellite libraries. SDL_TEXTUREACCESS_STATIC, 16, 16); Texture sprite2(renderer, "sprite.png"); // SDL_image support - Font font("Vera.ttf"); // SDL_ttf font + Font font("Vera.ttf", 20); // SDL_ttf font // Create texture from surface containing text rendered by SDL_ttf - Texture text(font.RenderText_Solid("Hello, world!", - SDL_Color({255, 255, 255, 255}))); + Texture text(renderer, font.RenderText_Solid("Hello, world!", + SDL_Color{255, 255, 255, 255})); unsigned char pixels[16 * 16 * 4]; diff --git a/examples/ttf.cc b/examples/ttf.cc index 81f8f8c..d5aec66 100644 --- a/examples/ttf.cc +++ b/examples/ttf.cc @@ -38,12 +38,12 @@ int Run() { Font font(TESTDATA_DIR "/Vera.ttf", 30); - Surface solid = font.RenderText_Solid("Hello, world! (solid mode)", SDL_Color({255, 255, 255, 255})); - Surface shaded = font.RenderText_Shaded("Hello, world! (shaded mode)", SDL_Color({255, 255, 255, 255}), SDL_Color({127, 127, 127, 255})); - Surface blended = font.RenderText_Blended("Hello, world! (blended mode)", SDL_Color({255, 255, 255, 255})); + Surface solid = font.RenderText_Solid("Hello, world! (solid mode)", SDL_Color{255, 255, 255, 255}); + Surface shaded = font.RenderText_Shaded("Hello, world! (shaded mode)", SDL_Color{255, 255, 255, 255}, SDL_Color{127, 127, 127, 255}); + Surface blended = font.RenderText_Blended("Hello, world! (blended mode)", SDL_Color{255, 255, 255, 255}); font.SetOutline(1); - Surface outline = font.RenderText_Blended("Hello, world! (blended + outline)", SDL_Color({255, 255, 255, 255})); + Surface outline = font.RenderText_Blended("Hello, world! (blended + outline)", SDL_Color{255, 255, 255, 255}); Texture solid_tex(render, solid); Texture shaded_tex(render, shaded);