SDL
2.0
|
Go to the source code of this file.
Macros | |
#define | SDL_TESTFONTDATAMAX (8*256) |
Functions | |
int | SDLTest_DrawCharacter (SDL_Renderer *renderer, int x, int y, char c) |
Draw a string in the currently set font. More... | |
int | SDLTest_DrawString (SDL_Renderer *renderer, int x, int y, const char *s) |
Draw a string in the currently set font. More... | |
void | SDLTest_CleanupTextDrawing (void) |
Cleanup textures used by font drawing functions. More... | |
Variables | |
static unsigned char | SDLTest_FontData [SDL_TESTFONTDATAMAX] |
static SDL_Texture * | SDLTest_CharTextureCache [256] |
Global cache for 8x8 pixel font textures created at runtime. More... | |
#define SDL_TESTFONTDATAMAX (8*256) |
Definition at line 31 of file SDL_test_font.c.
Cleanup textures used by font drawing functions.
Definition at line 3239 of file SDL_test_font.c.
References i, NULL, SDL_arraysize, and SDL_DestroyTexture.
int SDLTest_DrawCharacter | ( | SDL_Renderer * | renderer, |
int | x, | ||
int | y, | ||
char | c | ||
) |
Draw a string in the currently set font.
renderer | The renderer to draw on. |
x | The X coordinate of the upper left corner of the character. |
y | The Y coordinate of the upper left corner of the character. |
c | The character to draw. |
Definition at line 3117 of file SDL_test_font.c.
References FONT_CHARACTER_SIZE, SDL_Rect::h, NULL, SDL_Surface::pitch, SDL_Surface::pixels, SDL_CreateRGBSurface, SDL_CreateTextureFromSurface, SDL_FreeSurface, SDL_GetRenderDrawColor, SDL_RenderCopy, SDL_SetTextureAlphaMod, SDL_SetTextureColorMod, SDL_SWSURFACE, SDLTest_FontData, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by SDLTest_DrawString().
int SDLTest_DrawString | ( | SDL_Renderer * | renderer, |
int | x, | ||
int | y, | ||
const char * | s | ||
) |
Draw a string in the currently set font.
renderer | The renderer to draw on. |
x | The X coordinate of the upper left corner of the string. |
y | The Y coordinate of the upper left corner of the string. |
s | The string to draw. |
Definition at line 3222 of file SDL_test_font.c.
References FONT_CHARACTER_SIZE, and SDLTest_DrawCharacter().
Referenced by main().
|
static |
Global cache for 8x8 pixel font textures created at runtime.
Definition at line 3115 of file SDL_test_font.c.
|
static |
Definition at line 33 of file SDL_test_font.c.
Referenced by SDLTest_DrawCharacter().