README.md 1.95 KB
Newer Older
Florian Blasius's avatar
Florian Blasius committed
1
2
# OrbRender

3
[![Build status](https://gitlab.redox-os.org/FloVanGH/orbrender/badges/master/build.svg)](https://gitlab.redox-os.org/FloVanGH/orbrender/pipelines)
Florian Blasius's avatar
Florian Blasius committed
4
5
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)

Florian Blasius's avatar
Florian Blasius committed
6
7
8
The aim of OrbRender is to provide an uniform API for window creation, window drawing and request of window events. OrbRender could work with different client
libraries like [OrbClient](https://gitlab.redox-os.org/redox-os/orbclient), [winit](https://github.com/tomaka/winit), [WebRender](https://github.com/servo/webrender), 
[rust-cairo](https://gitlab.redox-os.org/redox-os/rust-cairo) and [stdweb](https://github.com/koute/stdweb).
9
10

> 3D rendering features will follow
11
12
13
14
15
16
17

## Primary target platforms

* Redox OS
* Linux
* Windows
* macOS
Florian Blasius's avatar
Florian Blasius committed
18
* Web
19
20
21
22
23

## Planned target platforms

* Android
* iOS
24

Florian Blasius's avatar
Florian Blasius committed
25
26
27
28
29
30
## Usage

To include OrbRender in your project, just add the dependency
line to your `Cargo.toml` file:

```text
31
orbrender = { git = https://gitlab.redox-os.org/FloVanGH/orbrender.git }
Florian Blasius's avatar
Florian Blasius committed
32
33
```

34
35
36
37
38
39
40
41
42
## Web setup

To run the examples on a browser you have to install 

```text
cargo install -f cargo-web
```

## Examples
Florian Blasius's avatar
Florian Blasius committed
43
44
45

You find the examples in the `examples/` directory.

Florian Blasius's avatar
Florian Blasius committed
46
You can start the drawing example by executing the following command:
47
48

```text
Florian Blasius's avatar
Florian Blasius committed
49
cargo run --example drawing --release
50
51
52
53
54
```

* Compile to [WebAssembly](https://en.wikipedia.org/wiki/WebAssembly) using Rust's native WebAssembly backend:

```text
Florian Blasius's avatar
Florian Blasius committed
55
cargo web start --target=wasm32-unknown-unknown --auto-reload --example drawing
56
57
58
59
60
```

* Compile to [asm.js](https://en.wikipedia.org/wiki/Asm.js) using Emscripten:

```text
Florian Blasius's avatar
Florian Blasius committed
61
$ cargo web start --target=asmjs-unknown-emscripten --auto-reload --example drawing
62
63
64
```

* Compile to WebAssembly using Emscripten:
Florian Blasius's avatar
Florian Blasius committed
65
66

```text
Florian Blasius's avatar
Florian Blasius committed
67
$ cargo web start --target=wasm32-unknown-emscripten --auto-reload --example drawing
68
69
70
71
72
73
74
75
```

## Build and run documenation

You can build and run the latest documentation y executing the following command:

```text
cargo doc --no-deps --open
Florian Blasius's avatar
Florian Blasius committed
76
```