This Gist was automatically created by Carbide, a free online programming environment.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std/[strformat, strutils, bitops] | |
import pixie, chroma | |
# define `nort` when opengl or windows system is not available. | |
when not defined(nort): | |
import nimgl/[glfw, opengl] | |
proc `{}`(image: var Image, x, y: int): var ColorRGBX = | |
## Accessing any pixels outside the bounds of the image is error | |
when not defined(danger): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// build: | |
// | |
// gcc -O0 -g main.c -I$HOME/.local/include -L$HOME/.local/lib -ljanet | |
// run: | |
// | |
// export LD_LIBRARY_PATH=$HOME/.local/lib | |
// ./a.out | |
#include "janet.h" |