31 #define SDL_TESTFONTDATAMAX (8*256) 3126 const unsigned char *charpos;
3140 srect.
w = charWidth;
3141 srect.
h = charHeight;
3148 drect.
w = charWidth;
3149 drect.
h = charHeight;
3152 ci = (
unsigned char)c;
3157 if (SDLTest_CharTextureCache[ci] ==
NULL) {
3162 charWidth, charHeight, 32,
3163 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);
3164 if (character ==
NULL) {
3170 pitch = character->
pitch;
3176 for (iy = 0; iy < charWidth; iy++) {
3179 for (ix = 0; ix < charWidth; ix++) {
3180 if (!(mask >>= 1)) {
3185 *(
Uint32 *)curpos = 0xffffffff;
3201 if (SDLTest_CharTextureCache[ci] ==
NULL) {
3217 result |=
SDL_RenderCopy(renderer, SDLTest_CharTextureCache[ci], &srect, &drect);
3228 const char *curchar =
s;
3230 while (*curchar && !result) {
3243 if (SDLTest_CharTextureCache[i]) {
3245 SDLTest_CharTextureCache[
i] =
NULL;
GLdouble GLdouble GLdouble r
static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX]
int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s)
Draw a string in the currently set font.
GLint GLint GLint GLint GLint x
A collection of pixels used in software blitting.
#define SDL_TESTFONTDATAMAX
#define SDL_CreateTextureFromSurface
static SDL_Renderer * renderer
#define FONT_CHARACTER_SIZE
static SDL_Texture * SDLTest_CharTextureCache[256]
Global cache for 8x8 pixel font textures created at runtime.
#define SDL_GetRenderDrawColor
GLint GLint GLint GLint GLint GLint y
#define SDL_SetTextureColorMod
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
#define SDL_CreateRGBSurface
#define SDL_DestroyTexture
#define SDL_arraysize(array)
GLboolean GLboolean GLboolean GLboolean a
GLboolean GLboolean GLboolean b
A rectangle, with the origin at the upper left.
void SDLTest_CleanupTextDrawing(void)
Cleanup textures used by font drawing functions.
#define SDL_SetTextureAlphaMod
int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c)
Draw a string in the currently set font.