<commit_before># gfx-rs

A lightweight graphics device manager for Rust.

## Design Goals

- Lightweight implementation
- Minimal public API
- Low performance overhead
- Graphics API agnostic (OpenGL/DirectX)
- Maths library agnostic
- Clear documentation with examples

## Note

gfx-rs is still in the early stages of development. Help is most appreciated.
Contact me on `irc.mozilla.org #rust-gamedev` if you are interested in helping
out. My handle is usually `bjz`.<commit_msg>Flesh out README with a specification of the problem and possible solutions<commit_after># gfx-rs

A lightweight buffer, shader and render queue manager for Rust.

## The Problem

- Graphics APIs (Especially OpenGL), require the liberal use of unsafe
  operations and non-ideomatic code
- Moving large amounts of data around is expensive
- Syncing draw calls across tasks is difficult
- Draw calls are most efficient when performed in bulk
- Many rendering engines are sprawling frameworks that require applications to
  be tightly coupled with their abstractions

## Design Goals

- Simple, lightweight implementation
- Low performance overhead
- Graphics API agnostic (OpenGL/DirectX)
- Maths library agnostic
- Composable (a library, not a framework)
- Compatible with Rust's task-based concurrency model
- Clear documentation with examples

## Possible Solutions

- Use a handle-based API to manage buffer and shader objects. This would allow
  data to be packed in arrays as opposed to being distributed across
  tree-based struct heirachies. It would also make batch processing easier.
  See `research.md` for more information on this data model. One issue with
  this model could be the problem of 'handle lifetimes' - ie. what happens if
  the data associated with a handle is removed? Using this model could negate
  some of the advantages of using Rust in the first place.
- Leave scene and model managment up to the client, and focus instead on
  buffers and shaders. Provide ways of accessing the underlying rendering API,
  to allow clients to make use of advanced, non-standard features if neccesary.
- Provide structural data types (as opposed to nominal ones) in order to make
  interfacing with other maths libraries easier. For example:

~~~rust
pub type Vertex4<T> = [T,..4];
pub type Matrix4x3<T> = [[T,..3],..4];
~~~

## Note

gfx-rs is still in the early stages of development. Help is most appreciated.
Contact me on `irc.mozilla.org #rust-gamedev` if you are interested in helping
out. My handle is usually `bjz`.
{'fraction_non_alphanumeric': 0.056393963463065924, 'fraction_numerical': 0.0023828435266084196, 'mean_word_length': 4.183127572016461, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5841745', 'n_tokens_mistral': 676, 'n_tokens_neox': 642, 'n_words': 353}