Skip to content

Commit

Permalink
v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AldaronLau committed Jul 30, 2019
1 parent 64f3b87 commit dbcd854
Show file tree
Hide file tree
Showing 16 changed files with 965 additions and 73 deletions.
1 change: 1 addition & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
max_width = 80
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://free.plopgrizzly.com/semver/).
and this project adheres to [Semantic Versioning](https://code.plopgrizzly.com/semver/).

## [Unreleased]
### TODO
- Possibly redesign the controller API to be event based using a message queue.

## [0.4.0] - 2019-07-07
### Added
- `graphics` feature and support for graphical user interfaces.
- `clock` feature and support for getting date and time.

## [0.3.0] - 2019-05-23
### Added
- `controllers()` which returns a `ControllerIter`.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Contributors
- [JeronAldaron](https://github.com/JeronAldaron)
- [Aldarobot](https://github.com/Aldarobot)
30 changes: 16 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# Cala
#
# Copyright © 2017-2019 Jeron Aldaron Lau.
# Dual-licensed under either the MIT License or the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_BSL.txt or copy at https://www.boost.org/LICENSE_1_0.txt
# and accompanying file LICENSE_MIT.txt or copy at https://opensource.org/licenses/MIT)
# Dual-licensed under either the MIT License or the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_BSL.txt or copy at
# https://www.boost.org/LICENSE_1_0.txt and accompanying file LICENSE_MIT.txt or
# copy at https://opensource.org/licenses/MIT)

[package]
name = "cala"
version = "0.3.0"
authors = ["Jeron Aldaron Lau <jeronaldaron@gmail.com>"]
version = "0.4.0"
authors = ["Jeron Aldaron Lau <jeronlau@plopgrizzly.com>"]
edition = "2018"

license = "MIT / BSL-1.0"
description = "Cross-platform system interface for hardware IO."
documentation = "https://docs.rs/cala"
homepage = "https://jeronaldaron.github.io/cala/"
repository = "https://github.com/JeronAldaron/cala"
homepage = "https://aldarobot.plopgrizzly.com/cala"
repository = "https://github.com/aldarobot/cala"
readme = "README.md"
keywords = ["device", "platform-agnostic", "cross-platform", "io", "gui"]
categories = ["game-engines", "hardware-support", "multimedia", "os"]
Expand All @@ -26,18 +27,19 @@ wavy = {version = "0.1", optional = true} # audio
stronghold = {version = "0.2", optional = true} # file
serde = {version = "1.0", optional = true}
stick = {version = "0.7", optional = true} # joystick / controller
# barg = {path = "../barg", optional = true}
barg = {version = "0.1", optional = true}
chrono = {version = "0.4", optional = true} # clock

[package.metadata.docs.rs]
features = ["all"]
all-features = true
default-target = "x86_64-unknown-linux-gnu"

[features]
default = []
all = ["user", "audio", "files", "controller",
#"gui"
]
user = ["whoami"]
audio = ["wavy"]
files = ["stronghold", "serde"]
controller = ["stick"]
# gui = ["barg"]
graphics = ["barg", "timer"]
camera = []
clock = ["chrono", "timer"]
timer = []
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<img src="https://jeronaldaron.github.io/cala/icon.svg" alt="Cala" width="256px" height="256px">
</p>
<h1 align="center">
<img src="https://aldarobot.plopgrizzly.com/cala/icon.svg" alt="Cala" width="256px" height="256px">
</h1>

### Note
Cala is a complete redesign of previous library [ADI](https://crates.io/crates/adi). It is still in it's early stages.
Expand All @@ -16,20 +16,20 @@ Cala is a platform-agnostic system interface for hardware IO. This means that e
- Playing / recording audio (Linux)
- Filesystem loading / saving ZIP files (Linux, Windows)
- Game Controller - JoyStick (Linux)
- Hardware acceleration - SIMD, GPU (NOT IMPLEMENTED YET)
- Clock - Date, Time of day, Timer (NOT IMPLEMENTED YET)
- GUI - Render, Mouse & Keyboard (NOT IMPLEMENTED YET)
- Clock - Date, Time of day, Timer (All Platforms)
- Graphics - Render and User Interface (Linux)
- Camera - Webcam (NOT IMPLEMENTED YET)
- Hardware acceleration - SIMD, GPU (NOT IMPLEMENTED YET)
- Network - Bluetooth & Wifi Direct (NOT IMPLEMENTED YET)

## Getting Started
- TODO

## Links
- [Website](https://jeronaldaron.github.io/cala/)
- [Website](https://aldarobot.github.io/cala/)
- [Cargo](https://crates.io/crates/cala)
- [Documentation](https://docs.rs/cala)
- [Change Log](https://jeronaldaron.github.io/cala/CHANGELOG)
- [Contributors](https://jeronaldaron.github.io/cala/CONTRIBUTORS)
- [Code of Conduct](https://jeronaldaron.github.io/cala/CODEOFCONDUCT)
- [Change Log](https://aldarobot.github.io/cala/CHANGELOG)
- [Contributors](https://aldarobot.github.io/cala/CONTRIBUTORS)
- [Code of Conduct](https://aldarobot.github.io/cala/CODEOFCONDUCT)
- [Join Zulip Chat](https://plopgrizzly.zulipchat.com/join/pp13s6clnexk03tvlnrtjvi1/)
2 changes: 1 addition & 1 deletion examples/controller/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "controller"
version = "0.1.0"
authors = ["Jeron Aldaron Lau <jeronaldaron@gmail.com>"]
authors = ["Jeron Aldaron Lau <jeronlau@plopgrizzly.com>"]
edition = "2018"

[dependencies.cala]
Expand Down
2 changes: 1 addition & 1 deletion examples/monitoring/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "monitoring"
version = "0.1.0"
authors = ["Jeron Aldaron Lau <jeronaldaron@gmail.com>"]
authors = ["Jeron Aldaron Lau <jeronlau@plopgrizzly.com>"]
edition = "2018"

[dependencies.cala]
Expand Down
2 changes: 1 addition & 1 deletion examples/user/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "user"
version = "0.1.0"
authors = ["Jeron Aldaron Lau <jeronaldaron@gmail.com>"]
authors = ["Jeron Aldaron Lau <jeronlau@plopgrizzly.com>"]
edition = "2018"

[dependencies.cala]
Expand Down
14 changes: 14 additions & 0 deletions examples/video/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "video"
version = "0.1.0"
authors = ["Jeron Aldaron Lau <[email protected]>"]
edition = "2018"
build = "build.rs"

[dependencies.cala]
features = ["graphics"]
path = "../../"

[build-dependencies]
# yeet = { path = "../../../yeet" }
res = "0.3" # { path = "../../../res" }
6 changes: 6 additions & 0 deletions examples/video/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fn main() {
res::generate(&[res::shader("color")
.transform()
.gradient()
.num_instances(2)]);
}
71 changes: 71 additions & 0 deletions examples/video/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
use cala::ShaderBuilder;

#[allow(unused)]
pub struct Context {
colors: cala::Shader,
triangle: cala::Shape,
timed: cala::TimedLoop,
}

// Initialize & set loop to `init()`.
cala::init!(run, {
// Set the background color.
cala::background(0.0, 1.0, 0.0);

// Load a shader.
let mut colors = cala::shader!("color");

// Define vertices.
#[rustfmt::skip]
let vertices = [
-0.5, -0.5, 1.0, 0.5, 0.0,
0.5, -0.5, 0.0, 0.0, 1.0,
0.0, 0.5, 1.0, 1.0, 1.0,
];

// Build triangle Shape
let mut triangle =
cala::Shape::new(cala::shape(&mut colors).vert(&vertices).face([
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0],
]));

triangle.instances(&[
cala::Transform::new()
.scale(0.5, 0.5, 0.5)
.translate(-0.5, 0.0, 0.0),
cala::Transform::new()
.scale(0.5, 0.5, 0.5)
.translate(0.5, 0.0, 0.0),
]);

// Finish building shader.
cala::build(&colors);

let timed = cala::TimedLoop::new(1, 0);

Context {
colors,
triangle,
timed,
}
});

// Function that runs while your app runs.
pub fn run(context: &mut Context) -> cala::Loop<Context> {
context.timed.add();
let delta: f32 = context.timed.into();

context.triangle.transform(0, cala::Transform::new()
.scale(0.5, 0.5, 0.5)
.translate(-0.5, -0.5 + delta, 0.0)
);

// Draw triangle
cala::draw(&context.colors, &context.triangle);

// Request next frame.
cala::Continue
}
Loading

0 comments on commit dbcd854

Please sign in to comment.