Skip to content

Commit dd57eda

Browse files
authored
Merge pull request #51 from lambda-sh/vmarcella/runtime-upgrades
Runtime updates
2 parents 68a0cbf + 82f06ad commit dd57eda

40 files changed

+896
-603
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
<p align="center" style="text-align:center;">
2-
<img src="https://media.githubusercontent.com/media/lambda-sh/lambda/main/lambda/assets/logos/lambda_header.png" />
2+
<img src="https://media.githubusercontent.com/media/lambda-sh/lambda/main/crates/lambda-rs/assets/logos/lambda_header.png" />
33
</p>
44

55
[![Cross Platform builds & tests](https://github.com/lambda-sh/lambda/actions/workflows/compile_lambda_rs.yml/badge.svg)](https://github.com/lambda-sh/lambda/actions/workflows/compile_lambda_rs.yml)
6-
7-
6+
![lambda-rs](https://img.shields.io/crates/d/lambda-rs)
7+
![lambda-rs](https://img.shields.io/crates/v/lambda-rs)
88

99
## Table of contents
1010
1. [Description](#description)
11-
2. [API Documentation](#documentation)
12-
3. [Building](#building)
11+
1. [API Documentation](#documentation)
12+
1. [Building](#building)
13+
1. [From crates.io](#crates)
1314
1. [From source](#source)
1415
1. [External dependencies](#ext_deps)
15-
2. [Optional depedencies](#opt_deps)
16-
3. [Linux, Macos, Windows](#bash)
17-
5. [Getting started](#get_started)
18-
6. [Examples](#examples)
19-
7. [Planned additions](#plans)
20-
8. [How to contribute](#contribute)
21-
9. [Resources](#resources)
16+
1. [Optional dependencies](#opt_deps)
17+
1. [Linux, Macos, Windows](#bash)
18+
1. [Getting started](#get_started)
19+
1. [Examples](#examples)
20+
1. [Planned additions](#plans)
21+
1. [How to contribute](#contribute)
22+
1. [Resources](#resources)
2223
## Description <a name="description"></a>
2324
Lambda is a framework for developing cross platform applications and workloads using Rust.
2425

@@ -45,12 +46,26 @@ lightweight HTML/CSS based rendering in the future but we're primarily focused
4546
on implementing a Rust native UI framework built on top of our rendering engine.
4647

4748
## Documentation <a name="documentation"></a>
48-
Documentation to be added soon.
49+
* [lambda-rs API documentation](https://docs.rs/lambda-rs/2023.1.29/lambda/)
50+
51+
## Installation <a name="building"></a>
4952

50-
## Building <a name="building"></a>
53+
### From crates.io <a name="crates"></a>
54+
lambda is now available on [crates.io](https://crates.io/crates/lambda-rs)
55+
and can be added to your project by adding the following to your
56+
`Cargo.toml` file:
57+
58+
```toml
59+
[dependencies]
60+
lambda-rs = "2023.1.29"
61+
```
62+
63+
or from the CLI:
64+
```bash
65+
cargo add lambda-rs
66+
```
5167

5268
### From source <a name="source"></a>
53-
Currently, building from source is the only method to obtain a copy of Lambda.
5469

5570
#### Required external dependencies <a name="ext_deps"></a>
5671
* All platforms
@@ -106,6 +121,11 @@ An example of using shaders with push constants to render a 3D image.
106121
cargo run --example push_constants
107122
```
108123

124+
#### Notes
125+
* On windows, you need to run this example with
126+
`--features lambda-rs/with-vulkan` as the shader used in the example does not work
127+
in either dx11 or dx12.
128+
109129
### Triangle
110130
An example using shaders to render a single triangle.
111131
```rust
@@ -135,11 +155,10 @@ cargo run --example triangles
135155
- [x] Metal
136156
- [x] DirectX11
137157
- [x] DirectX12
138-
- ### Crates
139-
- [x] (WIP) lambda-args -- Command line argument parsing.
140-
- [x] (WIP) lambda-platform -- Dependency wrappers & platform support.
141-
- [ ] lambda-cloud -- Cloud integrations.
142-
- [x] (WIP) lambda -- The public Lambda API.
158+
- ### Packages
159+
- [x] (WIP) [lambda-rs-args](./crates/lambda-rs-args/README.md) -- Command line argument parsing.
160+
- [x] (WIP) [lambda-rs-platform](./crates/lambda-rs-platform/README.md) -- Dependency wrappers & platform support.
161+
- [x] (WIP) [lambda-rs](./crates/lambda-rs/README.md) -- The public Lambda API.
143162
- ### Examples
144163
- [x] Minimal -- A minimal example of an application with a working window
145164
using lambda.

crates/lambda-rs-args/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "lambda-rs-args"
33
description = "Argument parser for lambda-rs tools."
4-
version = "2023.1.27-1"
4+
version = "2023.1.28"
55
edition = "2021"
66
license = "MIT"
77

crates/lambda-rs-args/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# lambda-rs-args
2+
![lambda-rs](https://img.shields.io/crates/d/lambda-rs-args)
3+
![lambda-rs](https://img.shields.io/crates/v/lambda-rs-args)
4+
5+
Argument parsing for lambda-rs applications.
6+
7+
## Getting started
8+
TODO

crates/lambda-rs-platform/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "lambda-rs-platform"
33
description = "Platform implementations for lambda-rs"
4-
version = "2023.1.27-1"
4+
version = "2023.1.29"
55
edition = "2021"
66
resolver = "2"
77
license = "MIT"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# lambda-rs-platform
2+
![lambda-rs](https://img.shields.io/crates/d/lambda-rs-platform)
3+
![lambda-rs](https://img.shields.io/crates/v/lambda-rs-platform)
4+
5+
Platform implementations for lambda-rs. This crate is not intended to be used directly and guarantees no stability across versions.
6+
7+
## Platforms
8+
The following platforms are currently supported:
9+
* Windows
10+
* Vulkan
11+
* DirectX 11
12+
* DirectX 12
13+
* Linux
14+
* Vulkan
15+
* OpenGL
16+
* MacOS
17+
* Metal
18+
* Vulkan

crates/lambda-rs-platform/src/shaderc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl ShaderCompilerBuilder {
1616
let compiler =
1717
shaderc::Compiler::new().expect("Failed to create shaderc compiler.");
1818

19-
let mut options = shaderc::CompileOptions::new()
19+
let options = shaderc::CompileOptions::new()
2020
.expect("Failed to create shaderc compile options.");
2121

2222
return ShaderCompiler {

crates/lambda-rs-platform/src/winit/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Winit wrapper to easily construct cross platform windows
2+
13
use winit::{
24
dpi::{
35
LogicalSize,
@@ -25,6 +27,7 @@ pub mod winit_exports {
2527
event::{
2628
ElementState,
2729
Event,
30+
MouseButton,
2831
VirtualKeyCode,
2932
WindowEvent,
3033
},

crates/lambda-rs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "lambda-rs"
33
description = "A framework for building cross platform graphics & compute applications."
4-
version = "2023.1.27-1"
4+
version = "2023.1.29"
55
edition = "2021"
66
license = "MIT"
77
keywords = ["graphics", "compute"]
@@ -12,7 +12,7 @@ name = "lambda"
1212
path = "src/lib.rs"
1313

1414
[dependencies]
15-
lambda-rs-platform = { path = "../lambda-rs-platform", version = "2023.1.27-1"}
15+
lambda-rs-platform = { path = "../lambda-rs-platform", version = "2023.1.29"}
1616

1717
[dev-dependencies]
1818
cargo-audit = "0.16.0"

crates/lambda-rs/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<p align="center" style="text-align:center;">
2+
<img src="https://media.githubusercontent.com/media/lambda-sh/lambda/main/crates/lambda-rs/assets/logos/lambda_header.png" />
3+
</p>
4+
5+
![lambda-rs](https://img.shields.io/crates/d/lambda-rs)
6+
![lambda-rs](https://img.shields.io/crates/v/lambda-rs)
7+
8+
The lambda-rs crate provides a safe, cross-platform API for building applications on the Lambda platform.
9+
10+
# Installation
11+
```bash
12+
cargo add lambda-rs
13+
```
14+
15+
# Getting started
16+
## First window
17+
Getting started with lambda is easy. The following example will create a window with the title "Hello lambda!" and a size of 800x600.
18+
```rust
19+
#[macro_use]
20+
use lambda::{
21+
core::runtime::start_runtime,
22+
runtimes::ApplicationRuntimeBuilder,
23+
};
24+
25+
fn main() {
26+
let runtime = ApplicationRuntimeBuilder::new("Hello lambda!")
27+
.with_window_configured_as(move |window_builder| {
28+
return window_builder
29+
.with_dimensions(800, 600)
30+
.with_name("Hello lambda!");
31+
})
32+
.build();
33+
34+
start_runtime(runtime);
35+
}
36+
```

0 commit comments

Comments
 (0)