Remove unneeded parentheses, fix README example

This commit is contained in:
Dmitry Marakasov 2015-01-21 23:15:18 +03:00
parent 3ac98e50f6
commit 2869db24ef
2 changed files with 7 additions and 7 deletions

View File

@ -26,11 +26,11 @@ This library provides C++11 bindings/wrapper for SDL2 and satellite libraries.
SDL_TEXTUREACCESS_STATIC, 16, 16); SDL_TEXTUREACCESS_STATIC, 16, 16);
Texture sprite2(renderer, "sprite.png"); // SDL_image support 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 // Create texture from surface containing text rendered by SDL_ttf
Texture text(font.RenderText_Solid("Hello, world!", Texture text(renderer, font.RenderText_Solid("Hello, world!",
SDL_Color({255, 255, 255, 255}))); SDL_Color{255, 255, 255, 255}));
unsigned char pixels[16 * 16 * 4]; unsigned char pixels[16 * 16 * 4];

View File

@ -38,12 +38,12 @@ int Run() {
Font font(TESTDATA_DIR "/Vera.ttf", 30); Font font(TESTDATA_DIR "/Vera.ttf", 30);
Surface solid = font.RenderText_Solid("Hello, world! (solid 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 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 blended = font.RenderText_Blended("Hello, world! (blended mode)", SDL_Color{255, 255, 255, 255});
font.SetOutline(1); 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 solid_tex(render, solid);
Texture shaded_tex(render, shaded); Texture shaded_tex(render, shaded);