24#define PICO_TITLE "pico-SDL"
25#define PICO_DIM_PHY ((Pico_Dim) {640,360})
26#define PICO_DIM_LOG ((Pico_Dim) { 64, 36})
42#define PICO_BOTTOM 100
53#define PICO_SIZE_KEEP ((Pico_Dim) {0,0})
54#define PICO_SIZE_FULLSCREEN ((Pico_Dim) {0,1})
379#define pico_assert(x) if (!(x)) { fprintf(stderr,"%s\n",SDL_GetError()); assert(0 && "SDL ERROR"); }
void pico_init(int on)
Initializes and terminates pico.
void pico_output_clear(void)
Clears screen with color set by pico_set_color_clear.
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 ...
void pico_output_present(void)
Shows what has been drawn onto the screen. Only does anything on expert mode.
void pico_output_draw_pixels(const Pico_Pos *apos, int count)
Draws a batch of pixels.
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_text_ext(Pico_Pos pos, const char *text, Pico_Dim size)
Draws text with the specified size.
void pico_output_draw_oval(Pico_Rect rect)
Draws an ellipse.
void pico_output_draw_tri(Pico_Rect rect)
Draws a triangle with a right angle at bottom-left.
const char * pico_output_screenshot(const char *path)
Takes a screenshot.
void pico_output_draw_rect(Pico_Rect rect)
Draws a rectangle.
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_text(Pico_Pos pos, const char *text)
Draws text.
void pico_output_draw_poly(const Pico_Pos *apos, int count)
Draws a polygon.
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_draw_fmt_ext(Pico_Pos pos, Pico_Dim size, const char *fmt,...)
void pico_output_draw_image(Pico_Pos pos, const char *path)
Draws an image.
void pico_output_draw_line(Pico_Pos p1, Pico_Pos p2)
Draws a line.
void pico_output_draw_fmt(Pico_Pos pos, const char *fmt,...)
void pico_output_draw_pixel(Pico_Pos pos)
Draws a single pixel.
void pico_output_write(const char *text)
Draws text with an internal cursor as reference, like in text editors. The cursor position updates to...
Pico_Dim pico_get_size_image(const char *file)
Gets the size of the given image.
Pico_Size pico_get_size(void)
Gets the physical and logical window size.
void pico_set_flip(Pico_Flip flip)
Sets the flipping state of objects.
void pico_set_color_draw(Pico_Color color)
Changes the color used to draw objects.
Uint32 pico_get_ticks(void)
Gets the amount of ticks that passed since pico was initialized.
Pico_Color pico_get_color_draw(void)
Gets the color set to draw.
void pico_set_style(PICO_STYLE style)
Sets the drawing style.
void pico_set_scroll(Pico_Pos pos)
Sets the point of view on the logical window.
Pico_Dim pico_get_size_text(const char *text)
Gets the size of the given text.
void pico_set_anchor_draw(Pico_Anchor anchor)
Changes the reference to draw objects (center, topleft, etc).
void pico_set_anchor_rotate(Pico_Anchor anchor)
Changes the reference to rotate objects (center, topleft, etc).
void pico_set_crop(Pico_Rect crop)
Changes the cropping that is applied to images before drawing them.
PICO_STYLE pico_get_style(void)
Gets the drawing style.
void pico_set_size(Pico_Dim phy, Pico_Dim log)
Sets the physical and logical window sizes.
int pico_get_show(void)
Gets the visibility state of the window.
void pico_set_title(const char *title)
Sets the aplication title.
void pico_set_expert(int on)
Toggles the expert mode.
Pico_Color pico_get_color_clear(void)
Gets the color set to clear the screen.
void pico_set_font(const char *file, int h)
Changes the font used to draw texts.
Pico_Pct pico_get_zoom(void)
Gets the scaling factor of the screen view (percentage).
void pico_set_zoom(Pico_Pct zoom)
Sets the scaling factor of the screen view.
int pico_get_rotate(void)
Gets the rotation angle of objects (in degrees).
int pico_get_grid(void)
Gets the state of the logical pixel grid.
Pico_Pct pico_get_scale(void)
Gets the scaling factor of objects (percentage).
const char * pico_get_title(void)
Gets the aplication title.
Pico_Pos pico_get_scroll(void)
Gets the point of view on the logical window.
void pico_set_cursor(Pico_Pos pos)
Sets the position of the text cursor.
int pico_get_expert(void)
Gets the state of expert mode.
void pico_set_color_clear(Pico_Color color)
Changes the color used to clear the screen.
void pico_set_grid(int on)
Toggles a grid on top of logical pixels.
Pico_Anchor pico_get_anchor_rotate(void)
Gets the origin used to rotate objects (center, topleft, etc).
Pico_Anchor pico_get_anchor_draw(void)
Gets the origin used to draw objects (center, topleft, etc).
Pico_Flip pico_get_flip(void)
Gets the flipping state of objects.
Pico_Rect pico_get_crop(void)
Gets the cropping applied to objects when drawing them.
void pico_set_rotate(int angle)
Sets the rotation angle of objects (in degrees).
void pico_set_scale(Pico_Pct scale)
Sets the scaling factor of objects.
Pico_Pos pico_get_cursor(void)
Gets the position of the text cursor.
void pico_set_show(int on)
Toggles the aplication window visibility.
const char * pico_get_font(void)
Gets the font used to draw texts.
PICO_STYLE
Definition pico.h:44
SDL_Point Pico_Anchor
Definition pico.h:33
SDL_Point Pico_Flip
Definition pico.h:34
SDL_Point Pico_Pct
Definition pico.h:35
SDL_Point Pico_Dim
Definition pico.h:30
SDL_Rect Pico_Rect
Definition pico.h:31
SDL_Point Pico_Pos
Definition pico.h:29
SDL_Color Pico_Color
Definition pico.h:32
@ PICO_FILL
Definition pico.h:45
@ PICO_STROKE
Definition pico.h:45
int pico_rect_vs_rect(Pico_Rect r1, Pico_Rect r2)
Checks if two rectangles overlap. Assumes that both rectangles use the same anchor.
Pico_Pos pico_pos_ext(Pico_Pct pct, Pico_Rect r, Pico_Anchor anc)
Returns a coordinate relative to the given rectangle's position.
int pico_pos_vs_rect_ext(Pico_Pos pt, Pico_Rect r, Pico_Anchor ap, Pico_Anchor ar)
Checks if a point is inside a rectangle.
Pico_Pos pico_pos(Pico_Pct pct)
Returns a coordinate relative to the screen rectangle.
Pico_Dim pico_dim_ext(Pico_Pct pct, Pico_Dim d)
Returns a size relative to the given rectangle's size.
Pico_Dim pico_dim(Pico_Pct pct)
Returns a size relative to the screen size.
int pico_pos_vs_rect(Pico_Pos pt, Pico_Rect r)
Checks if a point is inside a rectangle. Assumes that both primitives use the same anchor.
int pico_rect_vs_rect_ext(Pico_Rect r1, Pico_Rect r2, Pico_Anchor a2, Pico_Anchor a1)
Checks if two rectangles with different anchors overlap.
Pico_Dim log
Definition pico.h:50
Pico_Dim phy
Definition pico.h:49