Function cgl_rs::graphics::widgets::begin

source ·
pub fn begin() -> bool
Expand description

Begins a new CGL frame

Returns

Returns true if the frame was successfully created, otherwise returns false

Example

cgl_rs::init();
let mut window = cgl_rs::Window::new("CGL Window", 800, 600).unwrap();
cgl_rs::graphics::init();
cgl_rs::graphics::widgets::init();
 
while !window.should_close() {
    // bind framebuffers, etc.
    cgl_rs::graphics::widgets::begin(); // you could also check if the function returns true
        // draw widgets here
    cgl_rs::graphics::widgets::end();
    // update window, swap buffers, etc.
    break; // for testing purposes
}
 
cgl_rs::graphics::widgets::shutdown();
cgl_rs::graphics::shutdown();
window.destroy();
cgl_rs::shutdown();