Displaying forms

display functions

Here are describe the Form display utlities.

Line

int display_line(SDL_Renderer *pRenderer, Line *line)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • line (Line *) – The line to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display line.

This function display the line in the current color and at the current position.

Arc

int display_arc(SDL_Renderer *pRenderer, Arc *arc)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • arc (Arc *) – The arc to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display arc.

This function display the arc in the current color and at the current position.

Polygon

int display_polygon(SDL_Renderer *pRenderer, Form *polygon)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • polygon (Form *) – The polygon to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display polygon.

This function display the polygon lined in the current color and at the current position.

int display_strikethrough_polygon(SDL_Renderer *pRenderer, Form *polygon)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • polygon (Form *) – The polygon to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display strikethrough polygon.

This function display the polygon lined strikethrough in the current color and at the current position.

display_filled_polygon(SDL_Renderer *pRenderer, Form *polygon)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • polygon (Form *) – The polygon to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display filled polygon.

This function display the polygon filled in the current color and at the current position.

Pentagram & Hexagram

int display_pentagram(SDL_Renderer *pRenderer, Pentagram *pentagram)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • pentagram (Pentagram *) – The pentagram to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display pentagram.

This function display the pentagram in the current color and at the current position.

int display_hexagram(SDL_Renderer *pRenderer, Pentagram *hexagram)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • hexagram (Hexagram *) – The hexagram to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display hexagram.

This function display the hexagram in the current color and at the current position.

Star

int display_star(SDL_Renderer *pRenderer, Star *star)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display star.

This function display the star in the current color and at the current position.

int display_flower_star(SDL_Renderer *pRenderer, Star *star)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display flower star.

This function display the flower star in the current color and at the current position.

int display_strikethrough_star(SDL_Renderer *pRenderer, Star *star)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display strikethrough star.

This function display the strikethrough star in the current color and at the current position.

int display_polygon_star(SDL_Renderer *pRenderer, Star *star)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display polygon star.

This function display the polygon star in the current color and at the current position.

int display_filled_star(SDL_Renderer *pRenderer, Star *star)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display filled star.

This function display the strikethrough star in the current color and at the current position.

Spiral

int display_spiral(SDL_Renderer *pRenderer, Spiral *spiral)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • spiral (Spiral *) – The spiral to display.
Return type:

int

Returns:

0 on success, -1 on failure.

see:display spiral.

This function display the spiral in the current color and at the current position.

Anti-aliasing display functions

Line

int aa_display_line(SDL_Renderer *pRenderer, Line *line)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • line (Line *) – The line to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the line in the current color and at the current position.

Arc

int aa_display_arc(SDL_Renderer *pRenderer, Arc *arc)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • arc (Arc *) – The arc to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the arc in the current color and at the current position.

Polygon

int aa_display_polygon(SDL_Renderer *pRenderer, Form *polygon)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • polygon (Form *) – The polygon to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the polygon lined in the current color and at the current position.

int aa_display_strikethrough_polygon(SDL_Renderer *pRenderer, Form *polygon)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • polygon (Form *) – The polygon to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the polygon lined strikethrough in the current color and at the current position.

Pentagram & Hexagram

int aa_display_pentagram(SDL_Renderer *pRenderer, Pentagram *pentagram)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • pentagram (Pentagram *) – The pentagram to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the pentagram in the current color and at the current position.

int aa_display_hexagram(SDL_Renderer *pRenderer, Pentagram *hexagram)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • hexagram (Hexagram *) – The hexagram to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the hexagram in the current color and at the current position.

Star

int aa_display_star(SDL_Renderer *pRenderer, Star *star)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the star in the current color and at the current position.

int aa_display_flower_star(SDL_Renderer *pRenderer, Star *star)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the flower star in the current color and at the current position.

int aa_display_strikethrough_star(SDL_Renderer *pRenderer, Star *star)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the strikethrough star in the current color and at the current position.

int aa_display_polygon_star(SDL_Renderer *pRenderer, Star *star)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the polygon star in the current color and at the current position.

Spiral

int aa_display_spiral(SDL_Renderer *pRenderer, Spiral *spiral)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • spiral (Spiral *) – The spiral to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the spiral in the current color and at the current position.

Thickness settable display functions

Line

int display_line_thick(SDL_Renderer *pRenderer, Line *line, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • line (Line *) – The line to display.
  • thickness (uint8_t) – The line width.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the line in the current color and at the current position.

Arc

int display_arc_thick(SDL_Renderer *pRenderer, Arc *arc, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • arc (Arc *) – The arc to display.
  • thickness (uint8_t) – The line width.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the arc in the current color and at the current position.

Polygon

int display_polygon_thick(SDL_Renderer *pRenderer, Form *polygon, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • polygon (Form *) – The polygon to display.
  • thickness (uint8_t) – The line width.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the polygon lined in the current color and at the current position.

int display_strikethrough_polygon_thick(SDL_Renderer *pRenderer, Form *polygon, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • polygon (Form *) – The polygon to display.
  • thickness (uint8_t) – The line width.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the polygon lined strikethrough in the current color and at the current position.

Pentagram & Hexagram

int display_pentagram_thick(SDL_Renderer *pRenderer, Pentagram *pentagram, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • pentagram (Pentagram *) – The pentagram to display.
  • thickness (uint8_t) – The line width.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the pentagram in the current color and at the current position.

int display_hexagram_thick(SDL_Renderer *pRenderer, Pentagram *hexagram, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • hexagram (Hexagram *) – The hexagram to display.
  • thickness (uint8_t) – The line width.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the hexagram in the current color and at the current position.

Star

int display_star_thick(SDL_Renderer *pRenderer, Star *star, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
  • thickness (uint8_t) – The line width.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the star in the current color and at the current position.

int display_flower_star_thick(SDL_Renderer *pRenderer, Star *star, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
  • thickness (uint8_t) – The line width.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the flower star in the current color and at the current position.

int display_strikethrough_star_thick(SDL_Renderer *pRenderer, Star *star, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
  • thickness (uint8_t) – The line width.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the strikethrough star in the current color and at the current position.

int display_polygon_star_thick(SDL_Renderer *pRenderer, Star *star, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • star (Star *) – The star to display.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the polygon star in the current color and at the current position.

Spiral

int display_spiral_thick(SDL_Renderer *pRenderer, Spiral *spiral, uint8_t thickness)
Parameters:
  • pRenderer – A SDL_Renderer pointer.
  • spiral (Spiral *) – The spiral to display.
  • thickness (uint8_t) – The line width.
Return type:

int

Returns:

0 on success, -1 on failure.

This function display the spiral in the current color and at the current position.

Define your own displaying functions

Note

Define your own displaying functions.

You can implement your own displaying functions for per example:

  • Display every line from a polygon in an different color.
  • Display severals polygons filled overlaps in differents tones from a color with sinking alpha value.

And whatever your brain can imagined.