Draw function


Variables

int(*) salNewSurface (int width, int height, SDL_Surface *&surface)
 Create new draw surface.
int(*) salDrawRect (int x, int y, int width, int height, Uint32 color)
 Draw rectangle on main screen.
int(*) SALDrawRect (int x, int y, int width, int height, Uint32 color, SDL_Surface *surface)
 Draw rectangle on selected surface.
int(*) salFillRect (int x, int y, int width, int height, Uint32 color)
 Draw filled rectangle on main screen.
int(*) SALFillRect (int x, int y, int width, int height, Uint32 color, SDL_Surface *surface)
 Draw filled rectangle on selected surface.
int(*) salDrawLine (int x1, int y1, int x2, int y2, Uint32 color)
 Draw line on main screen.
int(*) SALDrawLine (int x1, int y1, int x2, int y2, Uint32 color, SDL_Surface *surface)
 Draw line on selected surface.
int(*) salDrawText (int x, int y, int width, int height, const char *text, Uint32 color)
 Draw text on main screen.
int(*) SALDrawText (int x, int y, int width, int height, const char *text, Uint32 color, TTF_Font *font, SDL_Surface *surface)
 Draw text on selected surface.
int(*) salDrawImage (int x, int y, int width, int height, SDL_Surface *image)
 Draw image on main screen.
int(*) salDrawCImage (int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2, SDL_Surface *image)
 Draw image on main screen.
int(*) SALDrawImage (int x, int y, int width, int height, SDL_Surface *image, SDL_Surface *surface)
 Draw image on main screen.
int(*) SALDrawCImage (int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2, SDL_Surface *image, SDL_Surface *surface)
 Draw image on main screen.
TTF_Font *(*) salLoadFont (const char *url, int size)
 Load font from file.
void(*) salClear (void)
 Clear screen.

Detailed Description

The SAL library uses "primitive" draw functions that are connected with library modules.
Note: These function don't auto update when salRefresh is used they will be "deleted".

Variable Documentation

void(*) salClear(void)

Clear screen.

Turns main screen to black.

Referenced by SAL_set_video_mode().

int(*) SALDrawCImage(int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2, SDL_Surface *image, SDL_Surface *surface)

Draw image on main screen.

Parameters:
x1 X position on image.
y1 Y position on image.
width1 (Max-)Width of image.
height1 (Max-)Height of image.
x2 X position on main screen.
y2 Y position on main screen.
width2 (Max-)Width on main screen.
height2 (Max-)Height on main screen.
image Surface of image.
surface Surface that image is drawn on.
Cut and draw image on other surface.

Referenced by SAL_set_video_mode().

int(*) salDrawCImage(int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2, SDL_Surface *image)

Draw image on main screen.

Parameters:
x1 X position on image.
y1 Y position on image.
width1 (Max-)Width of image.
height1 (Max-)Height of image.
x2 X position on main screen.
y2 Y position on main screen.
width2 (Max-)Width on main screen.
height2 (Max-)Height on main screen.
image Surface of image.
Cut and draw image on main screen.

Referenced by SAL_set_video_mode().

int(*) SALDrawImage(int x, int y, int width, int height, SDL_Surface *image, SDL_Surface *surface)

Draw image on main screen.

Parameters:
x X position of image.
y Y position of image.
width (Max-)Width of image.
height (Max-)Height of image.
image Surface of image.
surface Surface that image is drawn on.
Draw an image on other surface.

Referenced by SAL_set_video_mode().

int(*) salDrawImage(int x, int y, int width, int height, SDL_Surface *image)

Draw image on main screen.

Parameters:
x X position of image.
y Y position of image.
width (Max-)Width of image.
height (Max-)Height of image.
surface Surface of image.
Todo:
Needs param to set bg color.
Draw an image on main screen.

Referenced by SAL_set_video_mode().

int(*) SALDrawLine(int x1, int y1, int x2, int y2, Uint32 color, SDL_Surface *surface)

Draw line on selected surface.

Parameters:
x1 X position of position 1 of line.
y1 Y position of position 1 of line.
x2 X position of position 2 of line.
y2 Y position of position 2 of line.
color Color code of line.
surface Selected surface.
Draw a line on selected surface.

Referenced by SAL_set_video_mode().

int(*) salDrawLine(int x1, int y1, int x2, int y2, Uint32 color)

Draw line on main screen.

Parameters:
x1 X position of position 1 of line.
y1 Y position of position 1 of line.
x2 X position of position 2 of line.
y2 Y position of position 2 of line.
color Color code of line.
Draw a line on main screen.

Referenced by SAL_set_video_mode().

int(*) SALDrawRect(int x, int y, int width, int height, Uint32 color, SDL_Surface *surface)

Draw rectangle on selected surface.

Parameters:
x X position of rectangle.
y Y position of rectangle.
width Rectangle width.
height Rectangle height.
color Color code of rectangle.
surface Selected surface.
Draw a rectangle on selected surface.

Referenced by SAL_set_video_mode().

int(*) salDrawRect(int x, int y, int width, int height, Uint32 color)

Draw rectangle on main screen.

Parameters:
x X position of rectangle.
y Y position of rectangle.
width Rectangle width.
height Rectangle height.
color Color code of rectangle.
Draw a rectangle on main screen.

Referenced by SAL_set_video_mode().

int(*) SALDrawText(int x, int y, int width, int height, const char *text, Uint32 color, TTF_Font *font, SDL_Surface *surface)

Draw text on selected surface.

Parameters:
x X position of text.
y Y position of text.
width (Max-)Width of text.
height (Max-)Height of text.
color Color code of text.
font Font of text.
surface Selected surface.
Note:
Font and surface will switch
Draw a line on selected surface.

Referenced by SAL_set_video_mode().

int(*) salDrawText(int x, int y, int width, int height, const char *text, Uint32 color)

Draw text on main screen.

Parameters:
x X position of text.
y Y position of text.
width (Max-)Width of text.
height (Max-)Height of text.
color Color code of text.
Draw a line on main screen.

Referenced by SAL_set_video_mode().

int(*) SALFillRect(int x, int y, int width, int height, Uint32 color, SDL_Surface *surface)

Draw filled rectangle on selected surface.

Parameters:
x X position of rectangle.
y Y position of rectangle.
width Rectangle width.
height Rectangle height.
color Color code of rectangle.
surface Selected surface.
Draw a filled rectangle on selected surface.

Referenced by SAL_set_video_mode().

int(*) salFillRect(int x, int y, int width, int height, Uint32 color)

Draw filled rectangle on main screen.

Parameters:
x X position of rectangle.
y Y position of rectangle.
width Rectangle width.
height Rectangle height.
color Color code of rectangle.
Draw a filled rectangle on main screen.

Referenced by SAL_set_video_mode().

TTF_Font*(*) salLoadFont(const char *url, int size)

Load font from file.

Parameters:
url Url to file.
size Font size.
Load font from file and return font.

Referenced by salConf::getFont(), and SAL_set_video_mode().

int(*) salNewSurface(int width, int height, SDL_Surface *&surface)

Create new draw surface.

Note:
Always use this instead of own surface creation.
Parameters:
width Surface width.
height Surface height.
surface Returned surface.
Create a new surface to draw on. This surface is returned with the surface pointer

Referenced by SAL_set_video_mode().