Typedefs | |
typedef enum Encoding | Encoding |
An enumerate with encoding types RGB and BGR. More... | |
Enumerations | |
enum | Encoding { RGB , BGR } |
An enumerate with encoding types RGB and BGR. More... | |
Functions | |
EXPORT_SYM int | graphics_open (int width, int height) |
EXPORT_SYM void | graphics_close () |
EXPORT_SYM void | graphics_update () |
EXPORT_SYM void | graphics_clear () |
EXPORT_SYM void | graphics_blit_enc (const unsigned char *data, Encoding enc, int x, int y, int width, int height) |
EXPORT_SYM void | graphics_blit_region_enc (const unsigned char *data, Encoding enc, int sx, int sy, int ex, int ey, int width, int height, int dx, int dy) |
EXPORT_SYM void | graphics_fill (int r, int g, int b) |
EXPORT_SYM void | graphics_pixel (int x, int y, int r, int g, int b) |
EXPORT_SYM void | graphics_line (int x1, int y1, int x2, int y2, int r, int g, int b) |
EXPORT_SYM void | graphics_circle (int cx, int cy, int radius, int r, int g, int b) |
EXPORT_SYM void | graphics_circle_fill (int cx, int cy, int radius, int r, int g, int b) |
EXPORT_SYM void | graphics_rectangle (int x1, int y1, int x2, int y2, int r, int g, int b) |
EXPORT_SYM void | graphics_rectangle_fill (int x1, int y1, int x2, int y2, int r, int g, int b) |
EXPORT_SYM void | graphics_triangle (int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b) |
EXPORT_SYM void | graphics_triangle_fill (int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b) |
EXPORT_SYM int | get_key_state (enum KeyCode key) |
EXPORT_SYM void | get_mouse_position (int *x, int *y) |
EXPORT_SYM int | get_mouse_middle_button () |
EXPORT_SYM int | get_mouse_left_button () |
EXPORT_SYM int | get_mouse_right_button () |
void | graphics_segment_display (int s[], int x, int y, int r, int g, int b, float size) |
void | graphics_print_character (int n, int x, int y, int r, int g, int b, float size) |
void | graphics_print_string (char s[], int x, int y, int r, int g, int b, float size) |
int | graphics_print_int (int n, int minNumDigits, int x, int y, int r, int g, int b, float size) |
void | graphics_print_float (float n, int numDigits, int x, int y, int r, int g, int b, float size) |
enum Encoding |
EXPORT_SYM int get_key_state | ( | enum KeyCode | key | ) |
Gets the current state of a keyboard key.
key | An ASCII key code or a Key value from the KeyCode enum. |
EXPORT_SYM int get_mouse_left_button | ( | ) |
Returns the state of the mouse's left button.
EXPORT_SYM int get_mouse_middle_button | ( | ) |
Returns the state of the mouse's middle button.
EXPORT_SYM void get_mouse_position | ( | int * | x, |
int * | y | ||
) |
Returns the mouse's current position relative to the top left corner of the graphics window.
EXPORT_SYM int get_mouse_right_button | ( | ) |
Returns the state of the mouse's right button.
EXPORT_SYM void graphics_blit_enc | ( | const unsigned char * | data, |
Encoding | enc, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Blits a pixel array onto the graphics context
data | the 1D array of pixel data to blit |
enc | RGB for a Red-Green-Blue encoding or BGR for a Blue-Green-Red encoding |
x | The destination x coordinate of the blit (target) |
y | The destination y coordinate of the blit (target) |
width | The width of the area to blit |
height | The height of the area to blit |
EXPORT_SYM void graphics_blit_region_enc | ( | const unsigned char * | data, |
Encoding | enc, | ||
int | sx, | ||
int | sy, | ||
int | ex, | ||
int | ey, | ||
int | width, | ||
int | height, | ||
int | dx, | ||
int | dy | ||
) |
Blits a pixel array region onto the graphics context
data | the 1D array of pixel data to blit |
enc | RGB for a Red-Green-Blue encoding or BGR for a Blue-Green-Red encoding |
sx | The start x coordinate of the blit (source) |
sy | The start y coordinate of the blit (source) |
ex | The end x coordinate of the blit (source) |
ey | The end y coordinate of the blit (source) |
width | The width of the area to blit |
height | The height of the area to blit |
dx | The destination x coordinate of the blit (target) |
dy | The destination y coordinate of the blit (target) |
EXPORT_SYM void graphics_circle | ( | int | cx, |
int | cy, | ||
int | radius, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Draw an unfilled circle to the graphics window at the given coordinates and with the given radius.
cx | the X coordinate of the center of the circle |
cy | the Y cordinate of the center of the circle |
radius | the radius of the circle to be drawn |
r | the red component of the drawing, from 0 to 255 |
g | the green component of the drawing, from 0 to 255 |
b | the blue component of the drawing, from 0 to 255 |
EXPORT_SYM void graphics_circle_fill | ( | int | cx, |
int | cy, | ||
int | radius, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Draw a filled circle to the graphics window at the given coordinates and with the given radius.
cx | the X coordinate of the center of the circle |
cy | the Y cordinate of the center of the circle |
radius | the radius of the circle to be drawn |
r | the red component of the drawing, from 0 to 255 |
g | the green component of the drawing, from 0 to 255 |
b | the blue component of the drawing, from 0 to 255 |
EXPORT_SYM void graphics_clear | ( | ) |
Fills the entire window with the color black
EXPORT_SYM void graphics_close | ( | ) |
Closes the previously opened KISS Graphics Window
EXPORT_SYM void graphics_fill | ( | int | r, |
int | g, | ||
int | b | ||
) |
Fill the graphics context with a color.
r | the red component of the drawing, from 0 to 255 |
g | the green component of the drawing, from 0 to 255 |
b | the blue component of the drawing, from 0 to 255 |
EXPORT_SYM void graphics_line | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Draw a line from the point (x1, y1) to (x2, y2)
x1 | the X coordinate of the first point |
y1 | the Y coordinate of the first point |
x2 | the X coordinate of the second point |
y2 | the Y coordinate of the second point |
r | the red component of the drawing, from 0 to 255 |
g | the green component of the drawing, from 0 to 255 |
b | the blue component of the drawing, from 0 to 255 |
EXPORT_SYM int graphics_open | ( | int | width, |
int | height | ||
) |
Opens a KISS Graphics Window for drawing and input functions.
width | The width of the graphics window |
height | The height of the graphics window |
EXPORT_SYM void graphics_pixel | ( | int | x, |
int | y, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Draw a pixel at (x, y)
x | the X coordinate of the pixel |
y | the Y coordinate of the pixel |
r | the red component of the drawing, from 0 to 255 |
g | the green component of the drawing, from 0 to 255 |
b | the blue component of the drawing, from 0 to 255 |
void graphics_print_character | ( | int | n, |
int | x, | ||
int | y, | ||
int | r, | ||
int | g, | ||
int | b, | ||
float | size | ||
) |
Prints out a character in 16 segment characters
n | The character to display |
x | The X coordinate of the character's top-left corner |
y | The Y coordinate of the character's top-left corner |
r | The red component of the drawing, from 0 to 255 |
g | The green component of the drawing, from 0 to 255 |
b | The blue component of the drawing, from 0 to 255 |
size | The character's size |
void graphics_print_float | ( | float | n, |
int | numDigits, | ||
int | x, | ||
int | y, | ||
int | r, | ||
int | g, | ||
int | b, | ||
float | size | ||
) |
Prints out a float in 16 segment characters
n | The float to display |
numDigits | numDigits is the number of digits to right of decimal to be printed |
x | The X coordinate of the first character's top-left corner |
y | The Y coordinate of the first character's top-left corner |
r | The red component of the drawing, from 0 to 255 |
g | The green component of the drawing, from 0 to 255 |
b | The blue component of the drawing, from 0 to 255 |
size | The strings's size |
int graphics_print_int | ( | int | n, |
int | minNumDigits, | ||
int | x, | ||
int | y, | ||
int | r, | ||
int | g, | ||
int | b, | ||
float | size | ||
) |
Prints out an integer in 16 segment characters
n | The integer to display |
minNumDigits | minNumDigits is normally 0, but can be larger if leading 0's are desired |
x | The X coordinate of the first character's top-left corner |
y | The Y coordinate of the first character's top-left corner |
r | The red component of the drawing, from 0 to 255 |
g | The green component of the drawing, from 0 to 255 |
b | The blue component of the drawing, from 0 to 255 |
size | The strings's size |
void graphics_print_string | ( | char | s[], |
int | x, | ||
int | y, | ||
int | r, | ||
int | g, | ||
int | b, | ||
float | size | ||
) |
Prints out a text string in 16 segment characters
s | The string to display |
x | The X coordinate of the first character's top-left corner |
y | The Y coordinate of the first character's top-left corner |
r | The red component of the drawing, from 0 to 255 |
g | The green component of the drawing, from 0 to 255 |
b | The blue component of the drawing, from 0 to 255 |
size | The strings's size |
EXPORT_SYM void graphics_rectangle | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Draw an unfilled rectangle to the graphics window at the given coordinates.
x1 | the X coordinate of the rectangle's top-left corner |
y1 | the Y coordinate of the rectangle's top-left corner |
x2 | the X coordinate of the rectangle's bottom-right corner |
y2 | the Y coordinate of the rectangle's bottom-right corner |
r | the red component of the drawing, from 0 to 255 |
g | the green component of the drawing, from 0 to 255 |
b | the blue component of the drawing, from 0 to 255 |
EXPORT_SYM void graphics_rectangle_fill | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Draw a filled rectangle to the graphics window at the given coordinates.
x1 | the X coordinate of the rectangle's top-left corner |
y1 | the Y coordinate of the rectangle's top-left corner |
x2 | the X coordinate of the rectangle's bottom-right corner |
y2 | the Y coordinate of the rectangle's bottom-right corner |
r | the red component of the drawing, from 0 to 255 |
g | the green component of the drawing, from 0 to 255 |
b | the blue component of the drawing, from 0 to 255 |
void graphics_segment_display | ( | int | s[], |
int | x, | ||
int | y, | ||
int | r, | ||
int | g, | ||
int | b, | ||
float | size | ||
) |
Draw a 16 segment character (alphameric - caps only)
s | The segments to display |
x | The X coordinate of the first segment's top-left corner |
y | The Y coordinate of the first segment's top-left corner |
r | The red component of the drawing, from 0 to 255 |
g | The green component of the drawing, from 0 to 255 |
b | The blue component of the drawing, from 0 to 255 |
size | The segment's size |
EXPORT_SYM void graphics_triangle | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | x3, | ||
int | y3, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Draw an unfilled triangle to the graphics window at the given coordinates. The order of the corners does not matter when drawing a triangle.
x1 | the X coordinate of the triangle's first corner |
y1 | the Y coordinate of the triangle's first corner |
x2 | the X coordinate of the triangle's second corner |
y2 | the Y coordinate of the triangle's second corner |
x3 | the X coordinate of the triangle's third corner |
y3 | the Y coordinate of the triangle's third corner |
r | the red component of the drawing, from 0 to 255 |
g | the green component of the drawing, from 0 to 255 |
b | the blue component of the drawing, from 0 to 255 |
EXPORT_SYM void graphics_triangle_fill | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | x3, | ||
int | y3, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Draw a filled triangle to the graphics window at the given coordinates. The order of the corners does not matter when drawing a triangle.
x1 | the X coordinate of the triangle's first corner |
y1 | the Y coordinate of the triangle's first corner |
x2 | the X coordinate of the triangle's second corner |
y2 | the Y coordinate of the triangle's second corner |
x3 | the X coordinate of the triangle's third corner |
y3 | the Y coordinate of the triangle's third corner |
r | the red component of the drawing, from 0 to 255 |
g | the green component of the drawing, from 0 to 255 |
b | the blue component of the drawing, from 0 to 255 |
EXPORT_SYM void graphics_update | ( | ) |
Update must be called after drawing to the window for changes to be visible. This function also must be called regularly for input to work.