No description
Find a file
2016-12-30 18:37:45 +00:00
tests Add Nim source and tests. 2016-12-27 20:38:04 +00:00
.gitignore Initial commit 2016-12-27 20:26:36 +00:00
example.nim Add Nim source and tests. 2016-12-27 20:38:04 +00:00
LICENSE Initial commit 2016-12-27 20:26:36 +00:00
linuxfb.nim Add Nim source and tests. 2016-12-27 20:38:04 +00:00
linuxfb.nimble Remove quotes around "test" task name 2016-12-30 18:37:45 +00:00
readme.markdown Add Nim source and tests. 2016-12-27 20:38:04 +00:00

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