Find file
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (28 sloc) 812 Bytes
local ffi = require "ffi"
local host = require "bcm_host"
local bcm_host_lib = ffi.load("bcm_host");
The bcm_host_init() function must be called
before any other functions in the library can be
utilized. This will be done automatically
if the developer does:
require "bcm_host"
local GetDisplaySize = function(display_number)
display_number = display_number or 0
local pWidth ="uint32_t[1]");
local pHeight ="uint32_t[1]");
local err = lib.graphics_get_display_size(display_number, pWidth, pHeight);
-- Return immediately if there was an error
if err ~= 0 then
return false, err
return pWidth[0], pHeight[0];
return {
-- Libraries
Lib = lib,
bcm_host_lib = bcm_host_lib,
GetDisplaySize = GetDisplaySize,