Lightweight graphics libraries with C API

not GTK+ or SDL

Attached: qwe_download.jpg (1280x720, 99K)

Other urls found in this thread:

github.com/raysan5/raylib
twitter.com/NSFWRedditImage

mov al,13h
int 10h

Hahahah just draw straight to the framebuffer!

glew

if you don't want sdl but you want it to be light your options are opengl and nothing else
sfml if you don't really care about performance

opengl

How about and "open()"
int fd = open("/dev/fb0", O_RDWR);
Other neat tricks to try:
cat /dev/urandom > /dev/fb0

Just use fucking shaders.

thanks

This will break your screen btw.

Here the full code to write to the linux framebuffer:
#include
#include
#include
#include
#include
#include
#include
#include

int main(int argc, char **argv) {
int row, col, width, height;
unsigned int *data;

int fd = open("/dev/fb0", O_RDWR);

struct fb_var_screeninfo screeninfo;
ioctl(fd, FBIOGET_VSCREENINFO, &screeninfo);

width = screeninfo.xres;
height = screeninfo.yres;

data = (unsigned int*) mmap(0, width * height * bytespp, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);

for(row = 0; row < height; row++)
for(col = 0; col < width; col++)
data[row * width + col] = row ^ col;

munmap(data, width * height * bytespp);
close(fd);
return 0;
}


It won't get any more lightweight than that. No fancy libraries needed.

Takes me right back, it does

oops, misses:
int bytespp = screeninfo.bits_per_pixel / 8;

gdi

GLFW, make sure to handle events by callback instead of polling.

thanks
this dosnt work

You have to use it in a linux console. Won't work with X11 or Wayland.

github.com/raysan5/raylib
thank me later

based

no

works
any special way to use it to display text?