Skip to content

Raw NIM wrapper around the Linux framebuffer ioctls.

License

Notifications You must be signed in to change notification settings

luked99/linuxfb.nim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fblinux.nim

This is a raw wrapper around the Linux framebuffer driver ioctl API.

https://www.kernel.org/doc/Documentation/fb/api.txt

# example.nim
import linuxfb, os, posix

let fd = open("/dev/fb0", O_RDWR)

# current screen size
var var_info: fb_var_screeninfo
discard ioctl(fd, FBIOGET_VSCREENINFO, addr var_info)
echo "screen is ", var_info.xres, "x", var_info.yres, " with ", var_info.bits_per_pixel, "bits/pixel"

# screen identifier
var fix_info: fb_fix_screeninfo
discard ioctl(fd, FBIOGET_FSCREENINFO, addr fix_info)
echo "screen id ", fix_info.id

discard close(fd)

Run with: nim c -r example.nim

About

Raw NIM wrapper around the Linux framebuffer ioctls.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages