pico-sdl
Loading...
Searching...
No Matches
Output

Draw primitives, play sounds, etc. More...

Functions

void pico_output_clear (void)
 Clears screen with color set by pico_set_color_clear.
void pico_output_draw_buffer (Pico_Pos pos, const Pico_Color buffer[], Pico_Dim size)
 Draws an RGBA image that is managed by the user.
void pico_output_draw_image (Pico_Pos pos, const char *path)
 Draws an image.
void pico_output_draw_image_ext (Pico_Pos pos, const char *path, Pico_Dim size)
 Draws an image with the specified size.
void pico_output_draw_line (Pico_Pos p1, Pico_Pos p2)
 Draws a line.
void pico_output_draw_pixel (Pico_Pos pos)
 Draws a single pixel.
void pico_output_draw_pixels (const Pico_Pos *apos, int count)
 Draws a batch of pixels.
void pico_output_draw_rect (Pico_Rect rect)
 Draws a rectangle.
void pico_output_draw_tri (Pico_Rect rect)
 Draws a triangle with a right angle at bottom-left.
void pico_output_draw_oval (Pico_Rect rect)
 Draws an ellipse.
void pico_output_draw_poly (const Pico_Pos *apos, int count)
 Draws a polygon.
void pico_output_draw_text (Pico_Pos pos, const char *text)
 Draws text.
void pico_output_draw_text_ext (Pico_Pos pos, const char *text, Pico_Dim size)
 Draws text with the specified size.
void pico_output_draw_fmt (Pico_Pos pos, const char *fmt,...)
void pico_output_draw_fmt_ext (Pico_Pos pos, Pico_Dim size, const char *fmt,...)
void pico_output_present (void)
 Shows what has been drawn onto the screen. Only does anything on expert mode.
const char * pico_output_screenshot (const char *path)
 Takes a screenshot.
const char * pico_output_screenshot_ext (const char *path, Pico_Rect r)
 Takes a screenshot from a specific portion of the screen.
void pico_output_sound (const char *path)
 Plays a sound.
void pico_output_write (const char *text)
 Draws text with an internal cursor as reference, like in text editors. The cursor position updates to (x + len_text * FNT_SIZE, y).
void pico_output_writeln (const char *text)
 Draws a line of text with an internal cursor as reference, like in text editors. The cursor position updates to (x, y + FNT_SIZE).

Detailed Description

Draw primitives, play sounds, etc.

Function Documentation

◆ pico_output_clear()

void pico_output_clear ( void )

Clears screen with color set by pico_set_color_clear.

Examples
event_loop.c.

◆ pico_output_draw_buffer()

void pico_output_draw_buffer ( Pico_Pos pos,
const Pico_Color buffer[],
Pico_Dim size )

Draws an RGBA image that is managed by the user.

Parameters
posdrawing coordinate
bufferthe RGBA image
sizeimage size
See also
pico_output_draw_image
pico_output_draw_image_ext

◆ pico_output_draw_fmt()

void pico_output_draw_fmt ( Pico_Pos pos,
const char * fmt,
... )

◆ pico_output_draw_fmt_ext()

void pico_output_draw_fmt_ext ( Pico_Pos pos,
Pico_Dim size,
const char * fmt,
... )

◆ pico_output_draw_image()

void pico_output_draw_image ( Pico_Pos pos,
const char * path )

Draws an image.

Parameters
posdrawing coordinate
pathpath to the image file
See also
pico_output_draw_buffer
pico_output_draw_image_ext

◆ pico_output_draw_image_ext()

void pico_output_draw_image_ext ( Pico_Pos pos,
const char * path,
Pico_Dim size )

Draws an image with the specified size.

Parameters
posdrawing coordinate
pathpath to the image file
sizeimage size
See also
pico_output_draw_buffer
pico_output_draw_image

◆ pico_output_draw_line()

void pico_output_draw_line ( Pico_Pos p1,
Pico_Pos p2 )

Draws a line.

Parameters
p1first point
p2second point

◆ pico_output_draw_oval()

void pico_output_draw_oval ( Pico_Rect rect)

Draws an ellipse.

Parameters
rectbounds of the ellipse

◆ pico_output_draw_pixel()

void pico_output_draw_pixel ( Pico_Pos pos)

Draws a single pixel.

Parameters
posdrawing coordinate

◆ pico_output_draw_pixels()

void pico_output_draw_pixels ( const Pico_Pos * apos,
int count )

Draws a batch of pixels.

Parameters
aposarray of coordinates
countamount of coordinates

◆ pico_output_draw_poly()

void pico_output_draw_poly ( const Pico_Pos * apos,
int count )

Draws a polygon.

Parameters
aposarray of coordinates
countamount of coordinates

◆ pico_output_draw_rect()

void pico_output_draw_rect ( Pico_Rect rect)

Draws a rectangle.

Parameters
rectrectangle to draw

◆ pico_output_draw_text()

void pico_output_draw_text ( Pico_Pos pos,
const char * text )

Draws text.

Parameters
posdrawing coordinate
texttext to draw
See also
pico_output_draw_text_ext

◆ pico_output_draw_text_ext()

void pico_output_draw_text_ext ( Pico_Pos pos,
const char * text,
Pico_Dim size )

Draws text with the specified size.

Parameters
posdrawing coordinate
texttext to draw
sizetext size
See also
pico_output_draw_text

◆ pico_output_draw_tri()

void pico_output_draw_tri ( Pico_Rect rect)

Draws a triangle with a right angle at bottom-left.

Parameters
rectbounds of the triangle

◆ pico_output_present()

void pico_output_present ( void )

Shows what has been drawn onto the screen. Only does anything on expert mode.

See also
pico_set_expert
Examples
event_loop.c.

◆ pico_output_screenshot()

const char * pico_output_screenshot ( const char * path)

Takes a screenshot.

Parameters
pathscreenshot filepath (NULL uses timestamp in the name)
Returns
The filepath of the screenshot.
See also
pico_output_screenshot_ext

◆ pico_output_screenshot_ext()

const char * pico_output_screenshot_ext ( const char * path,
Pico_Rect r )

Takes a screenshot from a specific portion of the screen.

Parameters
pathscreenshot filepath (NULL uses timestamp in the name)
rregion to screenshot, in logical coordinates
Returns
The filepath of the screenshot.
See also
pico_output_screenshot

◆ pico_output_sound()

void pico_output_sound ( const char * path)

Plays a sound.

Parameters
pathpath to the audio file

◆ pico_output_write()

void pico_output_write ( const char * text)

Draws text with an internal cursor as reference, like in text editors. The cursor position updates to (x + len_text * FNT_SIZE, y).

Parameters
texttext to draw

◆ pico_output_writeln()

void pico_output_writeln ( const char * text)

Draws a line of text with an internal cursor as reference, like in text editors. The cursor position updates to (x, y + FNT_SIZE).

Parameters
texttext to draw