psychonautwiki / rust-ul-sys

Low Level Bindings to Ultralight Framework (Ultralight, AppCore)
18 stars 10 forks source link

ul-sys

Low level bindings to Ultralight SDK. Ultralight is a light and fast option to integrate GPU-accelerated HTML UI in your app.
crates.io documentation Ultralight SDK


let (width, height): (u32, u32) = (1280, 768);

let config = ul::ulCreateConfig();

let app = ul::ulCreateApp(config);
let monitor = ul::ulAppGetMainMonitor(app);
let window = ul::ulCreateWindow(monitor, width, height, false, 0);

ul::ulAppSetWindow(app, window);

let renderer = ul::ulAppGetRenderer(app);
let view = ul::ulCreateView(renderer, width, height, false);
let overlay = ul::ulCreateOverlay(window, width as i32, height as i32, 0, 0);
let view = ul::ulOverlayGetView(overlay);

ul::ulViewLoadURL(view, ulstr("https://apple.com"));

ul::ulAppRun(app);