17 个不稳定版本

0.2.1 2022年11月20日
0.2.0 2022年11月5日
0.1.0 2022年10月14日
0.0.3 2022年10月15日

#545图形 API

Download history 1/week @ 2024-03-11 5/week @ 2024-04-01

297 每月下载量
qrl 中使用

MIT 许可证

55KB
2K SLoC

QPL - Quigly 平台层

QPL 是一个平台抽象库。此库处理窗口管理、事件轮询、资源查询等。

使用方法

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
    }
}

支持的平台

当前已实现

  • Windows
  • Linux

计划中

  • WebAssembly
  • MacOS
  • Android
  • iOS

依赖项

~5.5MB
~129K SLoC