31 #define SDL_TESTFONTDATAMAX (8*256)
3119 const Uint32 charWidth = 8;
3120 const Uint32 charHeight = 8;
3121 const Uint32 charSize = 8;
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);
3224 const Uint32 charWidth = 8;
3228 const char *curchar =
s;
3230 while (*curchar && !result) {
DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
Get the color used for drawing operations (Rect, Line and Clear).
static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX]
DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface)
DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b)
Set an additional color value used in render copy operations.
A collection of pixels used in software blitting.
GLboolean GLboolean GLboolean GLboolean a
#define SDL_TESTFONTDATAMAX
DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect)
Copy a portion of the texture to the current rendering target.
uint32_t Uint32
An unsigned 32-bit integer type.
static SDL_Texture * SDLTest_CharTextureCache[256]
int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s)
Draw a string in the currently set font.
DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface)
Create a texture from an existing surface.
EGLSurface EGLint EGLint y
DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha)
Set an additional alpha value used in render copy operations.
uint8_t Uint8
An unsigned 8-bit integer type.
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble b
A rectangle, with the origin at the upper left.
int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c)