qpl

Crates.ioqpl
lib.rsqpl
version0.2.1
sourcesrc
created_at2022-10-14 04:56:59.220204
updated_at2022-11-20 18:41:26.451012
descriptionQuigly's Platform Layer
homepage
repositoryhttps://github.com/quigly/qpl
max_upload_size
id687936
size56,067
Quigly (quigly)

documentation

README

QPL - Quigly's Platform Layer

QPL is a platform abstraction library. This library handles windowing, event polling, resource querying, ect.

Usage

fn main()
{
    qpl::init();

    let mut window = qpl::create_window(&qpl::WindowCreateInfo
    {
        width: 1280,
        height: 720,
        title: "My Application",
        mode: qpl::WindowMode::Windowed,
        resizable: false,
        ..Default::default()
    });

    while !window.should_close
    {
        window.update_input_state();

        'event_loop: loop
        {
            match window.poll_events()
            {
                Some(event) =>
                {
                    match event
                    {
                        qpl::Event::Quit =>
                        {
                            window.should_close = true;
                            break 'event_loop;
                        },
                        _ => {}
                    }
                },
                None =>
                {
                    break 'event_loop;
                }
            }
        }

        // do your update and rendering
    }
}

Supported platforms

Currently implemented

  • Windows
  • Linux

Planned

  • Web assembly
  • MacOS
  • Android
  • iOS
Commit count: 48

cargo fmt