1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*! Buffer Objects are the main way of storing data to be used by the GPU

glin Buffers are typed but apart from that are just a light wrapper around OpenGL's

Immutable in this module refers to the OpenGL notion of immutable buffers where once allocated
it's capacity can't be changed but it's data can be modified dependnding on the flags it was
allocated with

More info: https://www.khronos.org/opengl/wiki/Buffer_Object
*/

pub use self::buffer::{Buffer, Builder};
pub use self::shared::{SharedBuffer, SharedBuilder};
#[cfg(all(not(feature = "gles"), not(feature="webgl")))]
pub use self::storage::BufferStorage;
#[cfg(all(not(feature = "gles"), not(feature="webgl")))]
pub use self::shared_storage::SharedBufferStorage;
pub use self::range::Range;
#[cfg(not(feature="webgl"))]
pub use self::map::*;
pub use self::traits::*;

mod buffer;
mod shared;
#[cfg(all(not(feature = "gles"), not(feature="webgl")))]
mod storage;
#[cfg(all(not(feature = "gles"), not(feature="webgl")))]
mod shared_storage;
mod traits;
mod backend;
#[cfg(not(feature="webgl"))]
mod map;
mod range;

pub fn cast<T,B>(buffer: B) -> <B as traits::Cast<T>>::CastTo
where B: traits::Cast<T>
{
    buffer.cast()
}