{"id":19608958,"url":"https://github.com/davecom/supersimplegraphics","last_synced_at":"2026-05-16T19:02:12.512Z","repository":{"id":66360401,"uuid":"148866969","full_name":"davecom/SuperSimpleGraphics","owner":"davecom","description":"An SVG generating single header file C library appropriate for \"intro to programming\" classes in C/C++.","archived":false,"fork":false,"pushed_at":"2018-11-01T03:47:11.000Z","size":14,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T09:52:51.502Z","etag":null,"topics":["intro-to-c","introduction-to-programming","svg"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davecom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-15T03:46:27.000Z","updated_at":"2022-09-22T11:05:37.000Z","dependencies_parsed_at":"2023-02-22T12:31:03.966Z","dependency_job_id":null,"html_url":"https://github.com/davecom/SuperSimpleGraphics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FSuperSimpleGraphics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FSuperSimpleGraphics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FSuperSimpleGraphics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FSuperSimpleGraphics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davecom","download_url":"https://codeload.github.com/davecom/SuperSimpleGraphics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240898273,"owners_count":19875151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["intro-to-c","introduction-to-programming","svg"],"created_at":"2024-11-11T10:18:44.305Z","updated_at":"2026-05-16T19:02:12.438Z","avatar_url":"https://github.com/davecom.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SuperSimpleGraphics\nThis is an extremely simplistic SVG generating single header file C library appropriate for \"intro to programming\" classes in C or C++. Using it is as simple as dropping `ssg.h` into your project and then `#include \"ssg.h\"` in your source file. Right now it is a hack done in a couple hours with two example programs as a proof of concept, so there's not yet a lot of error checking or features.\n\n## Documentation\nThere are only five functions for now:\n\n```C\nvoid start_graphics(int width, int height)\n```\nStarts the creation of a new SVG file with a canvas of `width` and `height` dimensions.\n\n```C\nvoid draw_ellipse(int x, int y, int width, int height, const char *color)\n```\nDraws an ellipse.\n\n```C\nvoid draw_rectangle(int x, int y, int width, int height, const char *color)\n```\nDraws a rectangle.\n\n```C\nvoid draw_line(int x1, int y1, int x2, int y2, const char *color)\n```\nDraws a line.\n\n```C\nvoid write_graphics(const char *name)\n```\nWrites an svg file with the filename `name` and the `.svg` extension. Frees any used memory and closes the file.\n\n## Examples\nSo far there are two simple examples included in this directory:\n- `france_flag.c` draws the French flag. \n\n![French Flag](flag.svg)\n\n- `sierpinski.c` draws sierpinski triangles \n\n![Sierpinski Triangles](sierpinski.svg)\n\nRunning them is as simple as:\n```bash\ngcc france_flag.c\n./a.out\n```\nThen a `.svg` file will be generated in the same directory. They have been tested with `clang` on macOS, `gcc` on GNU/Linux, and Visual C++ on Windows.\n\n## License\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavecom%2Fsupersimplegraphics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavecom%2Fsupersimplegraphics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavecom%2Fsupersimplegraphics/lists"}