GithubHelp home page GithubHelp logo

libcala / cala Goto Github PK

View Code? Open in Web Editor NEW
53.0 3.0 5.0 921 KB

Cross-platform system interface for hardware IO

Home Page: https://libcala.github.io/cala/

License: Apache License 2.0

Rust 99.14% GLSL 0.08% HTML 0.05% C 0.73%
rust-library gui-library game-library app-engine library graphics-library platform-agnostic cross-platform speaker sound

cala's Introduction

Cala

Make portable apps and video games in Rust!

docs.rs crates.io Zulip Chat

About | Source | Changelog | Tutorials | Blog

Are you sad that the standard library's only system interface is the filesystem? This crate is for you! This crate provides a safe abstraction over windowing, audio, accessibility, input, and video. This crate, however, is not intended to support multimedia format parsing - that's developed as a separate crate: Caved.

Cala is intended to be an "oxidized re-implementation" of both Flutter/GTK and SDL/other SDL projects in one library! Flutter is mostly intended for mobile applications, and GTK is just for desktop applications, but what if you want to develop the same app for both? Then you use this crate (a lot of features are still WIP)! Cala additionally targets the web and bare metal systems. Note also that even if you're not trying to make your application / video game extremely portable, you can still use this crate!

You might ask, "Shouldn't apps and video games use separate libararies; Why are they combined?". They usually need do the same thing, and some desktop application depend on SDL, like VLC, and some video games depend on GTK, like Veloren (at least when built on Linux). There's clearly a shared interest; so they should be combined. That said, Cala is extremely modular, and doesn't include any modules at all unless you enable some features. The modules are named exactly the same as the features, so you enable the camera feature to be able to use the camera module.

Naming

The name cala is derived from the fungus known as calafate rust.

Feature Support

Each system interface can be enabled with a feature. Names of features match the module names where the API is located. Just add it to your Cargo.toml:

[dependencies.cala]
version = "0.9"
features = ["log", "speaker"]

Here's a list of all of the targeted platforms and what they support.

  • ✓: supported
  • —: not planned / possible
  • ?: untested
Feature Linux MacOS Windows Web Android
bluetooth
camera
client
database
graphics 9 8
haptic
info
input 7 6
log
microphone 5 4 ?
port
random ?
server
speaker 4 ?
task
timer
usb
when
window 9

Module documentation may include simple tutorials. More in depth tutorials may be found here.

Not Yet Attempted Support, But Planned

  • iOS
  • Fuchsia
  • Redox
  • Nintendo Switch
  • XBox
  • PlayStation
  • BSD variants
  • Others not on this list that you will make a pull request for adding them

License

Licensed under any of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Contributors are always welcome (thank you for being interested!), whether it be a bug report, bug fix, feature request, feature implementation or whatever. Don't be shy about getting involved. I always make time to fix bugs, so usually a patched version of the library will be out a few days after a report. Features requests will not complete as fast. If you have any questions, design critques, or want me to find you something to work on based on your skill level, you can email me at [email protected]. Otherwise, here's a link to the issues on GitHub. Before contributing, check out the contribution guidelines, and, as always, make sure to follow the code of conduct.

cala's People

Contributors

aldaronlau avatar dependabot-preview[bot] 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cala's Issues

C API, Python bindings

This would be nice to have at some time in the future, when more functionality exists.

Dependabot couldn't fetch all your path-based dependencies

Dependabot couldn't fetch one or more of your project's path-based Rust dependencies. The affected dependencies were ../human/Cargo.toml, ../window/Cargo.toml and ../rvg/Cargo.toml.

To use path-based dependencies with Dependabot the paths must be relative and resolve to a directory in this project's source code.

View the update logs.

Rendering Optimization

I haven't focused much on optimization yet. And, it is quite important. A simple-ish game I'm working on goes down to as low as 9FPS under Vulkan. I ran perf to find the problems. These functions seem to be taking up the most time:

  • Vector::length
  • awi::render::vulkan::renderer::draw_shape
  • core::slice::sort_unstable

This seems to be related to a few algorithms I've come up with that need to get optimized.

  1. Depth Sort - Opaque objects sorted front to back, alpha back to front. Should stop using Vector::length and rather the z value multiplied by rotation.
  2. Batch Rendering of Shapes - Needs to be optimized to not re-bind the vertex buffer when the shape does not change
  3. Matrix Transforms - Camera needs to be handled specially so not all shapes are updated one by one.

By fixing these algorithms I hope to run at least 60FPS on my laptop.

Replace net module APIs

The main goal of this library is to be portable, and when running in a web browser Rust only has access to HTTP through Javascript, so implement sending/receiving simple POST (update), GET (read), PUT (create), DELETE (delete) (unfortunately can't receive these messages on a web page, so probably support SSE as well). This should not be a full blown web-framework.

Camera support?

I'm trying to find a cross-platform crate to read fullhd webcam frames at 30fps.
On windows I'm using a custom version of escapi (hacked to support MJPEG decoding with the mozjpeg-sys crate), but I also want to support linux..

Any idea when this crate will support camera capture? :)

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.