npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

tigr.c

v3.2.5

Published

TIGR - the TIny GRaphics library for Windows, macOS, Linux, iOS and Android.

Readme

TIGR - TIny GRaphics library

TIGR is a tiny cross-platform graphics library, providing a unified API for Windows, macOS, Linux, iOS and Android.

TIGR's core is a simple framebuffer library. On top of that, we provide a few helpers for the common tasks that 2D programs generally need:

  • Bitmap-backed windows.
  • Direct access to bitmaps, no locking.
  • Basic drawing helpers (plot, line, blitter).
  • Text output using bitmap fonts.
  • Mouse, touch and keyboard input.
  • PNG loading and saving.
  • Easy pixel shader access.

TIGR is designed to be small and independent. The 'hello world' example is less than 100kB:

| Platform | Size | | --- | --- | | windows x86_64 | 48k | | linux x86_64 | 43k | | macOS arm64 | 90k | | macOS x86_64 | 74k |

There are no additional libraries to include; everything is baked right into your program.

TIGR is free to copy with no restrictions; see tigr.h.

Installation

Run:

$ npm i tigr.c

And then include tigr.h as follows:

// main.c
#define TIGR_IMPLEMENTATION
#include "node_modules/tigr.c/tigr.h"

int main() { /* ... */ }

And then compile with clang or gcc as usual.

$ clang main.c  # or, use gcc
$ gcc   main.c

You may also use a simpler approach:

// main.c
#define TIGR_IMPLEMENTATION
#include <tigr.h>

int main() { /* ... */ }

If you add the path to node_modules/tigr.c to your compiler's include paths.

$ clang -I./node_modules/tigr.c main.c  # or, use gcc
$ gcc   -I./node_modules/tigr.c main.c

How do I program with TIGR?

Here's an example Hello World program. For more information, just read tigr.h to see the APIs available.

#include "tigr.h"

int main(int argc, char *argv[]) {
  Tigr *screen = tigrWindow(320, 240, "Hello", 0);
  while (!tigrClosed(screen)) {
    tigrClear(screen, tigrRGB(0x80, 0x90, 0xa0));
    tigrPrint(screen, tfont, 120, 110, tigrRGB(0xff, 0xff, 0xff), "Hello, world.");
    tigrUpdate(screen);
  }
  tigrFree(screen);
  return 0;
}

How to set up TIGR

Desktop (Windows, macOS, Linux)

To use it, you just include them into your project.

  1. Define TIGR_IMPLEMENTATION in one source file before including tigr.h.
  2. Link with
    • -lopengl32 and -lgdi32 on Windows
    • -framework OpenGL and -framework Cocoa on macOS
    • -lGLU -lGL -lX11 on Linux
  3. You're done!

Android

Due to the complex lifecycle and packaging of Android apps (there is no such thing as a single source file Android app), a tiny wrapper around TIGR is needed. Still - the TIGR API stays the same!

To keep TIGR as tiny and focused as it is, the Android wrapper lives in a separate repo.

To get started on Android, head over to the TIMOGR repo and continue there.

iOS

On iOS, TIGR is implemented as an app delegate, which can be used in your app with just a few lines of code.

Building 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.

To get started on iOS, head over to the TIMOGRiOS repo and continue there.

NOTE: TIGR is included in TIMOGR and TIMOGRiOS, there is no need to install TIGR separately.

Fonts and shaders

Custom fonts

TIGR 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.

Use the tigrfont tool to create your own bitmap fonts from TTF or BDF font files.

Since 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.

Custom pixel shaders

TIGR uses a built-in pixel shader that provides a couple of stock effects as controlled by tigrSetPostFX. These stock effects can be replaced by calling tigrSetPostShader with a custom shader. The 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.

See the shader example for more details.

Known issues

On 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.

SRC ORG