mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 10:55:57 -04:00
Remove unneeded parentheses, fix README example
This commit is contained in:
parent
3ac98e50f6
commit
2869db24ef
@ -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];
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user