glapp

Crates.ioglapp
lib.rsglapp
version0.1.3
sourcesrc
created_at2023-04-23 23:27:50.962597
updated_at2023-05-08 06:49:59.727313
descriptionGL context creation wrapper
homepagehttps://github.com/limikael/glapp
repositoryhttps://github.com/limikael/glapp
max_upload_size
id846918
size33,370
Mikael Lindqvist (limikael)

documentation

https://docs.rs/glapp

README

glapp

OpenGL meta window and context creation.

The window and graphics context creation pipeline in the Rust ecosystem is experiencing a kind of cambrian explosion at the moment, which is why it is good to be flexible possible when it comes to working with different underlying libraries and toolchains.

I created Glapp as a kind of "meta library", wrapping different underlying libraries, each with their respective strength depending on platform and situation.

The goal is that the code you write should be 100% transferrable from one platform to another. No need to mangle or name your main function differently depending on platform, glapp takes care of that. It should also be as easy as possible to get up and running. A simple example looks like:

use glapp::*;

#[glapp_main]
fn main(mut app:App) {
    app.title("Testing Glapp");
    app.run(|window,event|{
        match event {
            AppEvent::Open=>{
                // The OpenGL context is created and made current.
            },
            AppEvent::Render=>{
                // This is where we render our scene.
            },
            // ... see docs for more events, e.g. input and such ...
        }
    });
}

It should be understood that Glapp provides a kind on "least common denominator" when it comes to the functionality of these libraries. If you want more fine grained control, use respective library directly.

Libraries

Glapp can work with the following underlying libraries. Enable them as features:

  • sdl - Simple DirectMedia Layer is a cross-platform development library written in C. SDL officially supports Windows, macOS, Linux, iOS, and Android. SDL has been around since 1998 and is thoroughly battle tested.
  • glutin - Glutin is a pure Rust library with strong momentum and deep roots in the community.
Commit count: 18

cargo fmt