Browse Source

Exposed the font character size and SDLTest_DrawCharacter() to make it easier to do custom debug text layout

Sam Lantinga 11 years ago
parent
commit
9f2509da79
2 changed files with 127 additions and 113 deletions
  1. 15 1
      include/SDL_test_font.h
  2. 112 112
      src/test/SDL_test_font.c

+ 15 - 1
include/SDL_test_font.h

@@ -38,6 +38,20 @@ extern "C" {
 
 
 /* Function prototypes */
 /* Function prototypes */
 
 
+#define FONT_CHARACTER_SIZE  8
+
+/**
+ *  \brief Draw a string in the currently set font.
+ *
+ *  \param renderer The renderer to draw on.
+ *  \param x The X coordinate of the upper left corner of the character.
+ *  \param y The Y coordinate of the upper left corner of the character.
+ *  \param c The character to draw.
+ *
+ *  \returns Returns 0 on success, -1 on failure.
+ */
+int SDLTest_DrawCharacter( SDL_Renderer *renderer, int x, int y, char c );
+
 /**
 /**
  *  \brief Draw a string in the currently set font.
  *  \brief Draw a string in the currently set font.
  *
  *
@@ -48,7 +62,7 @@ extern "C" {
  *
  *
  *  \returns Returns 0 on success, -1 on failure.
  *  \returns Returns 0 on success, -1 on failure.
  */
  */
-int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s);
+int SDLTest_DrawString( SDL_Renderer * renderer, int x, int y, const char *s );
 
 
 
 
 /* Ends C function definitions when using C++ */
 /* Ends C function definitions when using C++ */

File diff suppressed because it is too large
+ 112 - 112
src/test/SDL_test_font.c


Some files were not shown because too many files changed in this diff