mirror of
https://github.com/italicsjenga/mini_gl_fb.git
synced 2024-11-26 09:21:30 +11:00
Update docs
This commit is contained in:
parent
46f2bf4bbc
commit
875eeeddc6
33
README.md
33
README.md
|
@ -1,7 +1,7 @@
|
||||||
# Mini GL "Framebuffer"
|
# Mini GL "Framebuffer"
|
||||||
|
|
||||||
Provides an easy way to draw a window from a pixel buffer. OpenGL alternative to other
|
Provides an easy way to draw a window from a pixel buffer. OpenGL alternative to other
|
||||||
easy "framebuffer" libraries.
|
easy framebuffer libraries.
|
||||||
|
|
||||||
Designed to be dead simple and easy to remember when you just want to get something on the
|
Designed to be dead simple and easy to remember when you just want to get something on the
|
||||||
screen ASAP!
|
screen ASAP!
|
||||||
|
@ -21,15 +21,38 @@ fn main() {
|
||||||
time. You can bring your own timing mechanism, whether it's just `sleep(ms)` or something more
|
time. You can bring your own timing mechanism, whether it's just `sleep(ms)` or something more
|
||||||
sophisticated.
|
sophisticated.
|
||||||
|
|
||||||
|
# Get full access to glutin for custom event handling
|
||||||
|
|
||||||
|
You can also "breakout" and get access to the underlying glutin window while still having easy
|
||||||
|
setup:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
let mut fb = mini_gl_fb::gotta_go_fast("Hello world!", 800.0, 600.0);
|
||||||
|
|
||||||
|
let GlutinBreakout {
|
||||||
|
mut events_loop,
|
||||||
|
gl_window,
|
||||||
|
mut fb,
|
||||||
|
} = fb.glutin_breakout();
|
||||||
|
|
||||||
|
fb.update_buffer(/*...*/);
|
||||||
|
```
|
||||||
|
|
||||||
|
# Other features
|
||||||
|
|
||||||
|
- Hardware accelerated buffer scaling (window and buffer can have different sizes)
|
||||||
|
- Exposes a function for creating a context with glutin in one line
|
||||||
|
- Exposes a function for creating a VAO, VBO, quad, and blank texture in one line
|
||||||
|
- If you don't want to use glutin you can **bring your own context** too!
|
||||||
|
|
||||||
|
See the docs for more info.
|
||||||
|
|
||||||
# Planned Features
|
# Planned Features
|
||||||
|
|
||||||
Listed in rough order of importance and ease (which are surprisingly correlated here!).
|
Listed in rough order of importance and ease (which are surprisingly correlated here!).
|
||||||
|
|
||||||
- Bounds check on `update_buffer` which will currently segfault if you pass the wrong size.
|
- Bounds check on `update_buffer` which will currently segfault if you pass the wrong size.
|
||||||
|
|
||||||
- Provide a way to break out of the `fb` object into the raw backing glutin window and event
|
|
||||||
loop so that you can easily provide interactivity.
|
|
||||||
|
|
||||||
- Shader playground. Add a method for using shadertoy-like fragment shaders to be applied to
|
- Shader playground. Add a method for using shadertoy-like fragment shaders to be applied to
|
||||||
your submitted pixel data.
|
your submitted pixel data.
|
||||||
|
|
||||||
|
@ -38,8 +61,6 @@ Listed in rough order of importance and ease (which are surprisingly correlated
|
||||||
alternatives include automatically drawing after running some event handlers and some
|
alternatives include automatically drawing after running some event handlers and some
|
||||||
methods for drawing at intervals (fixed/dynamic delta time).
|
methods for drawing at intervals (fixed/dynamic delta time).
|
||||||
|
|
||||||
- Provide a way to bring your own context/window.
|
|
||||||
|
|
||||||
- Fully replace and customize the vertex, geometry, and fragment shader, including adding your
|
- Fully replace and customize the vertex, geometry, and fragment shader, including adding your
|
||||||
own uniforms (but probably not adding any vertex attributes).
|
own uniforms (but probably not adding any vertex attributes).
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
|
//! The default buffer format is 32bit RGBA, so every pixel is four bytes. Buffer[0] is the top
|
||||||
|
//! left pixel.
|
||||||
|
//!
|
||||||
//! # Interlude: Library philosophy
|
//! # Interlude: Library philosophy
|
||||||
//!
|
//!
|
||||||
//! All of the internals of this library are exposed. Any fields behind `mini_gl_fb.internal`
|
//! All of the internals of this library are exposed. Any fields behind `mini_gl_fb.internal`
|
||||||
|
|
Loading…
Reference in a new issue