Jo Engine  9
Jo Sega Saturn Engine
Functions
background.h File Reference

Jo Engine Background definition and tools. More...

Go to the source code of this file.

Functions

void jo_draw_background_line (int x0, int y0, int x1, int y1, const jo_color color)
 Draw a line using Bresenham's line algorithm. More...
 
static __jo_force_inline void jo_put_pixel_in_background (const int x, const int y, const jo_color color)
 Put pixel in background using color. More...
 
static __jo_force_inline void jo_put_pixel_in_background_rgb (const int x, const int y, unsigned char r, unsigned char g, unsigned char b)
 Put pixel in background using composite color. More...
 
static __jo_force_inline void jo_move_background (const int x, const int y)
 Move background (scrolling) More...
 
static __jo_force_inline void jo_zoom_background2 (const float width_factor, const float height_factor)
 Zoom background width and height independently. More...
 
static __jo_force_inline void jo_zoom_background (const float factor)
 Zoom background. More...
 
void jo_set_background_sprite (const jo_img *const img, const unsigned short left, const unsigned short top)
 Add background sprite. More...
 
void jo_clear_background (const jo_color color)
 Clear the background. More...
 
static __jo_force_inline void jo_draw_background_square (const int x, const int y, const short width, const short height, const jo_color color)
 Draw a square on the background. More...
 

Detailed Description

Jo Engine Background definition and tools.

Author
Johannes Fetz
Bug:
No known bugs.

Function Documentation

void jo_clear_background ( const jo_color  color)

Clear the background.

Parameters
colorClear color
void jo_draw_background_line ( int  x0,
int  y0,
int  x1,
int  y1,
const jo_color  color 
)

Draw a line using Bresenham's line algorithm.

Parameters
x0horizontal location of the beginning of the line
y0vertical location of the beginning of the line
x1horizontal location of the end of the line
y1vertical location of the end of the line
colorColor (ex: JO_COLOR_Red)
static __jo_force_inline void jo_draw_background_square ( const int  x,
const int  y,
const short  width,
const short  height,
const jo_color  color 
)
static

Draw a square on the background.

Parameters
xSquare horizontal location
ySquare vertical location
widthSquare width
heightSquare height
colorColor (ex: JO_COLOR_Red)
static __jo_force_inline void jo_move_background ( const int  x,
const int  y 
)
static

Move background (scrolling)

Parameters
xhorizontal location
yvertical location
static __jo_force_inline void jo_put_pixel_in_background ( const int  x,
const int  y,
const jo_color  color 
)
static

Put pixel in background using color.

Parameters
xhorizontal location
yvertical location
colorColor (ex: JO_COLOR_Red)
static __jo_force_inline void jo_put_pixel_in_background_rgb ( const int  x,
const int  y,
unsigned char  r,
unsigned char  g,
unsigned char  b 
)
static

Put pixel in background using composite color.

Parameters
xhorizontal location
yvertical location
rRed color component
gGreen color component
bBlue color component
void jo_set_background_sprite ( const jo_img *const  img,
const unsigned short  left,
const unsigned short  top 
)

Add background sprite.

Parameters
imgPointer to an image struct
leftLeft location
topTop location
static __jo_force_inline void jo_zoom_background ( const float  factor)
static

Zoom background.

Parameters
factorZoom factor
static __jo_force_inline void jo_zoom_background2 ( const float  width_factor,
const float  height_factor 
)
static

Zoom background width and height independently.

Parameters
width_factorWidth zoom factor
height_factorHeight zoom factor