10 #define TEST_INPUT_RECT 12 #define GLYPH_SIZE_IMAGE 16 13 #define GLYPH_SIZE_SCREEN 32 15 #define MAX_CHARS 1024 120 || (key.
mod & compare.
mod)) {
121 index = compare.
index;
136 int renderW, renderH;
143 int line_separation = 5;
145 #ifdef TEST_INPUT_RECT 148 *y = (n / max_x_chars) * (GLYPH_SIZE_SCREEN + line_separation) + y_padding;
176 Uint32 Rmask, Gmask, Bmask, Amask;
187 printf(
"texture creation failed: %s\n",
SDL_GetError());
239 #ifdef TEST_INPUT_RECT 251 switch (event.
type) {
257 width =
event.window.data1;
258 height =
event.window.data2;
260 #ifdef TEST_INPUT_RECT
#define SDL_LoadBMP(file)
GLint GLint GLint GLint GLint x
#define GLYPH_SIZE_SCREEN
static SDL_Renderer * renderer
A collection of pixels used in software blitting.
#define SDL_SetTextureBlendMode
The SDL keysym structure, used in key events.
void drawGlyph(int glyph, int positionIndex)
fontMapping map[TABLE_SIZE]
GLint GLint GLsizei width
static int glyphs[MAX_CHARS]
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
#define SDL_GetWindowSize
#define SDL_StopTextInput
#define SDL_CreateTextureFromSurface
void getPositionForCharNumber(int n, int *x, int *y)
#define SDL_RenderSetLogicalSize
SDL_Texture * loadFont(void)
int main(int argc, char *argv[])
GLint GLint GLint GLint GLint GLint y
#define SDL_PixelFormatEnumToMasks
#define SDL_StartTextInput
SDL_Keymod
Enumeration of valid key mods (possibly OR'd together).
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)
static SDL_Texture * texture
GLint GLint GLsizei GLsizei height
#define SDL_CreateRGBSurface
#define SDL_SetTextInputRect
EGLSurface EGLNativeWindowType * window
int keyToGlyphIndex(SDL_Keysym key)
#define SDL_DestroyTexture
static SDL_Color bg_color
The type used to identify a window.
#define SDL_SetRenderDrawColor
#define SDL_DestroyRenderer
#define SDL_RenderGetLogicalSize
#define SDL_DestroyWindow
#define SDL_IsTextInputActive
SDL_Scancode
The SDL keyboard scancode representation.
#define SDL_CreateRenderer
A rectangle, with the origin at the upper left.
#define SDL_RenderPresent