Skip to content
This repository was archived by the owner on Mar 17, 2019. It is now read-only.

TI Nspire specific functions and macros

Christoffer Rehn edited this page May 11, 2014 · 61 revisions

These functions and macros are not part of standard SDL. As such, they are not portable across different platforms.

Functions

Type Function Description
SDL_Surface *
nSDL_LoadImage
(Uint16 *data)
Loads an NTI image. Returns NULL on error, a pointer to a 16-bit surface of the image on success.
nSDL_Font *
nSDL_LoadFont
(int font_index,
 Uint8 r, Uint8 g, Uint8 b)
Loads a font. Returns NULL on error. For a list of available fonts, click here.
int
nSDL_DrawString
(SDL_Surface *surface,
 nSDL_Font *font,
 int x, int y,
 const char *format, ...)
Draws a string to surface. Supports printf-like string formatting. Returns -1 on error, 0 on success.
int
nSDL_GetStringWidth
(nSDL_Font *font,
 const char *s)
Returns the width of a string, or a negative value on error.
int
nSDL_GetStringHeight
(nSDL_Font *font,
 const char *s)
Returns the height of a string, or a negative value on error.
void
nSDL_EnableFontMonospaced
(nSDL_Font *font,
 SDL_bool toggle)
Enables or disables fixed font spacing.
void
nSDL_SetFontSpacing
(nSDL_Font *font,
 int hspacing, int vspacing)
Sets horizontal and vertical font spacing.
void
nSDL_FreeFont
(nSDL_Font *font)
Frees a font from memory.
int
nSDL_EnableRelativePaths
(char **argv)
Enables the use of relative paths whenever loading files.
Uint32
nSDL_GetPixel
(SDL_Surface *surface,
 int x, int y)
Returns the pixel's color at (x, y). Assumes the surface has been locked. Does no clipping. Supports 8-, 16- and 32-bit surfaces.
void
nSDL_SetPixel
(SDL_Surface *surface,
 int x, int y,
 Uint32 color)
Draws a pixel to (x, y). Assumes the surface has been locked. Does no clipping. Supports 8-, 16- and 32-bit surfaces.

Macros

Name Description
NSDL_VERSION
String containing nSDL's version.
Clone this wiki locally