[−][src]Crate cala
Website | GitHub | Changelog | Tutorials
Note
Cala is a complete redesign of previous library ADI. It is still in it's early stages.
About
Easily create cross-platform applications. Some common tasks are not easily portable across different platforms, and this crate hopes to fix that. That way you don't have to worry about how to port your GUI, audio, or bluetooth interface, etc. and can get straight to building your application's content!
Cala is a platform-agnostic system interface for hardware IO. This means that eventually, Cala should support all of the different hardware that's connected to your computer. Cala is designed so that it talks to the operating system to interface with the hardware, so no special permissions are needed for your application. Here's a list of all of the targeted platforms (bold means a port has been made, italic means the feature doesn't work on the platform):
- Linux
- MacOS - missing audio, controller, graphics
- Windows - missing audio, controller, graphics
- Web (WASM) - missing audio, controller, graphics, files
- Redox
- Android
- iOS
- Nintendo Switch
- XBox
- PlayStation
- FreeBSD
- Maybe FreeDOS for fun 😉️
- Others not on this list that you will make a pull request for adding them
Motivation & Naming
The aim is to create a newer, better GTK + SDL in Rust! Why GTK + SDL? Because a lot of programs need to depend on both anyway (like totem), and they do a lot of the same things; Usually one library does each specific task better than the other. The goal of this library is to provide the common ground for video games and general GUI applications together. The name cala is derived from the fungus known as calafate rust.
Getting Started
Each hardware interface can be enabled with a feature. For example, If you
want to depend on the audio
feature and the clock
feature, you might put this in your Cargo.toml
:
[dependencies.cala]
version = "0.5"
features = ["audio", "clock"]
There is a module for each feature (feature and module names match). Module documentation may include simple tutorials. More in depth tutorials may be found here.
Modules
audio | API for recording / playing audio. Enable with the |
clock | API for getting the date and time of day. Enable with the |
controller | API for getting joystick / controller / gamepad input. Enable with the
|
files | API for loading & saving files. Enable with the |
graphics | API for rendering graphics. Enable with the |
user | API for getting user information. Enable with the |
Macros
info | Log an informative (stdout) message in both release and debug mode. |
init | Define the entry point for your program. |
note | Log an informative (stdout) message only in debug mode. |
shader | video Load a generated shader from |
warn | Log a warning (stderr) message in both release and debug mode. |
Enums
Loop | Cala program control flow loop. |
Functions
delta | Get nanoseconds passed since previous frame. |