{"id":15366789,"url":"https://github.com/erkkah/tigr","last_synced_at":"2025-04-12T22:30:58.659Z","repository":{"id":39718745,"uuid":"161090042","full_name":"erkkah/tigr","owner":"erkkah","description":"TIGR - the TIny GRaphics library for Windows, macOS, Linux, iOS and Android.","archived":false,"fork":false,"pushed_at":"2023-12-16T03:40:51.000Z","size":1886,"stargazers_count":791,"open_issues_count":14,"forks_count":50,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-04T01:32:28.354Z","etag":null,"topics":["2d-graphics","android","cross-platform","ios","linux","osx","tigr","tiny-graphics-library","windows"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erkkah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-09T23:08:46.000Z","updated_at":"2025-03-30T14:39:38.000Z","dependencies_parsed_at":"2023-02-17T06:31:13.485Z","dependency_job_id":"a8cf1885-ca62-4a17-a9c6-2c236dfa5d2d","html_url":"https://github.com/erkkah/tigr","commit_stats":{"total_commits":205,"total_committers":10,"mean_commits":20.5,"dds":"0.25853658536585367","last_synced_commit":"ff7307a534082b903446ddcda3aa6f42c7eb4328"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftigr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftigr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftigr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftigr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erkkah","download_url":"https://codeload.github.com/erkkah/tigr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248639772,"owners_count":21137904,"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":["2d-graphics","android","cross-platform","ios","linux","osx","tigr","tiny-graphics-library","windows"],"created_at":"2024-10-01T13:19:50.803Z","updated_at":"2025-04-12T22:30:58.623Z","avatar_url":"https://github.com/erkkah.png","language":"C","readme":"# TIGR - TIny GRaphics library\n\n![](./tigr.png)\n\nTIGR is a tiny cross-platform graphics library,\nproviding a unified API for Windows, macOS, Linux, iOS and Android.\n\nTIGR's core is a simple framebuffer library.\nOn top of that, we provide a few helpers for the common tasks that 2D programs generally need:\n\n - Bitmap-backed windows.\n - Direct access to bitmaps, no locking.\n - Basic drawing helpers (plot, line, blitter).\n - Text output using bitmap fonts.\n - Mouse, touch and keyboard input.\n - PNG loading and saving.\n - Easy pixel shader access.\n\nTIGR is designed to be small and independent.\nThe 'hello world' example is less than 100kB:\n\n| *Platform* | *Size* |\n| --- | --- |\n| windows x86_64 | 48k |\n| linux x86_64 | 43k |\n| macOS arm64 | 90k |\n| macOS x86_64 | 74k |\n\nThere are no additional libraries to include; everything is baked right into your program.\n\nTIGR is free to copy with no restrictions; see [tigr.h](tigr.h).\n\n## How do I program with TIGR?\n![](./demo.gif)\n\nHere's an example Hello World program. For more information, just read [tigr.h](tigr.h) to see the APIs available.\n\n```C\n#include \"tigr.h\"\n\nint main(int argc, char *argv[])\n{\n    Tigr *screen = tigrWindow(320, 240, \"Hello\", 0);\n    while (!tigrClosed(screen))\n    {\n        tigrClear(screen, tigrRGB(0x80, 0x90, 0xa0));\n        tigrPrint(screen, tfont, 120, 110, tigrRGB(0xff, 0xff, 0xff), \"Hello, world.\");\n        tigrUpdate(screen);\n    }\n    tigrFree(screen);\n    return 0;\n}\n```\n\n## How to set up TIGR\n\n### Desktop (Windows, macOS, Linux)\n\nTIGR is supplied as a single .c and corresponding .h file.\n\nTo use it, you just drop them right into your project.\n\n1. Grab  **tigr.c** and **tigr.h**\n2. Throw them into your project.\n3. Link with\n    - -lopengl32 and -lgdi32 on Windows\n    - -framework OpenGL and -framework Cocoa on macOS\n    - -lGLU -lGL -lX11 on Linux\n4. You're done!\n\n### Android\n\nDue to the complex lifecycle and packaging of Android apps\n(there is no such thing as a single source file Android app),\na tiny wrapper around TIGR is needed. Still - the TIGR API stays the same!\n\nTo keep TIGR as tiny and focused as it is, the Android wrapper lives in a separate repo.\n\nTo get started on Android, head over to the [TIMOGR](https://github.com/erkkah/timogr) repo and continue there.\n\n### iOS\n\nOn iOS, TIGR is implemented as an app delegate, which can be used in your app with just a few lines of code.\n\nBuilding an iOS app usually requires quite a bit of tinkering in Xcode just to get up and running. To get up and running **fast**, there is an iOS starter project with a completely commandline-based tool chain, and VS Code configurations for debugging.\n\nTo get started on iOS, head over to the [TIMOGRiOS](https://github.com/erkkah/timogrios) repo and continue there.\n\n\u003e NOTE: TIGR is included in TIMOGR and TIMOGRiOS, there is no need to install TIGR separately.\n\n## Fonts and shaders\n\n### Custom fonts\n\nTIGR comes with a built-in bitmap font, accessed by the `tfont` variable. Custom fonts can be loaded from bitmaps using `tigrLoadFont`. A font bitmap contains rows of characters separated by same-colored borders. TIGR assumes that the borders use the same color as the top-left pixel in the bitmap. Each character is assumed to be drawn in white on a transparent background to make tinting work.\n\nUse the [tigrfont](https://github.com/erkkah/tigrfont) tool to create your own bitmap fonts from TTF or BDF font files.\n\nSince TIGR version 3.1, unicode-encoded font sheets are supported, making it possible to render any glyph in your fonts. Text is still just rendered LTR, though.\n\n### Custom pixel shaders\n\nTIGR uses a built-in pixel shader that provides a couple of stock effects as controlled by `tigrSetPostFX`.\nThese stock effects can be replaced by calling `tigrSetPostShader` with a custom shader.\nThe custom shader is in the form of a shader function: `void fxShader(out vec4 color, in vec2 uv)` and has access to the four parameters from `tigrSetPostFX` as a `uniform vec4` called `parameters`.\n\nSee the [shader example](examples/shader/shader.c) for more details.\n\n## Known issues\n\nOn macOS, seemingly depending on SDK version and if you use TIGR in an Xcode project, you need to define `OBJC_OLD_DISPATCH_PROTOTYPES` to avoid problems with `objc_msgSend` prototypes.\n","funding_links":[],"categories":["Game Programming"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkkah%2Ftigr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferkkah%2Ftigr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkkah%2Ftigr/lists"}