Code Monkey home page Code Monkey logo

async-winit's People

Contributors

notgull avatar robwalt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

async-winit's Issues

Allow users to intercept events

Many common patterns of GUI usage rely on being able to intercept events, making them unavailable for the rest of the system. It would be nice to be able to intercept events in Handler.

Do we need to be thread-safe?

This API is largely intended to be used from gui-tools, which is thread unsafe. Therefore, we may want to ask whether or not we even want to be thread safe in the first place.

Not being thread safe would allow us to reduce our dependencies, as well as reduce some of the edge cases.

Further Limitations with mutable access

Playing around with the lib, I unfortunately found the following limitation ๐Ÿ˜ข

 // create some wgpu_context bundling stuff for the gfx pipeline
// ...

            let resized = async {
                window
                    .resized()
                    .wait_many()
                    .for_each(|size| {
                        wgpu_context.resize(size);
                    })
                    .await;
                true
            };

            let redraw = async {
                window
                    .redraw_requested()
                    .wait_many()
                    .for_each(|_| {
                        wgpu_context.render().expect("Everything is fine .. ๐Ÿ”ฅ");
                    })
                    .await;
                true
            };
// ...

This example code doesn't compile since both the resize and render actions need mutable access to the wgp_contexts fields. The code is running without bundling everything into the struct but it limirs the ability to abstract all the low level details away. If there is a way to get the code above running I would be very happy but I see no easy way of doing that. If you also don't have an idea how to run that code, we could maybe mention that in the "Cons" part of the README. There is no free lunch after all ๐Ÿ˜ข ๐Ÿฅ– โŒ

Web support

Our current "block inside of the event handler" strategy for holding events doesn't work on the Web. I'm not sure if there is a solid way for this to translate to the Web without winit-native support for async event handlers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.