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
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
#![doc(html_logo_url = "https://rin.rs/logo.svg")]
#![doc(html_favicon_url = "https://rin.rs/favicon.ico")]

#[macro_use] extern crate glin;

#[cfg(feature = "gles")]
extern crate gl as glcrate;

#[cfg(not(feature = "gles"))]
extern crate gl;

#[macro_use] extern crate color;
extern crate na;
extern crate angle;
extern crate time;
extern crate regex;
extern crate ringraphics as graphics;
extern crate rinwindow as window;
extern crate rinutil as util;
extern crate rinmath as math;
extern crate rinio as io;
extern crate densevec;

pub use glin::*;
pub use gl::*;

pub use vao_mesh::VaoMesh;
pub use vao_path::{VaoPath, VaoPathFill, VaoPathContour};
pub use renderer::{Renderer, Render2d, Renderer2d, Render3d, Renderer3d, CreationContext, CreationProxy};
// pub use object::Object;
// pub use object::ObjectT;
pub use material::Material;
pub use basic_material::BasicMaterial;
pub use shader_material::ShaderMaterial;
pub use outline_material::OutlineMaterial;
pub use pbr_material::PbrMaterial;
pub use pointlight::PointLight;
pub use directional_light::DirectionalLight;
pub use spot_light::SpotLight;
pub use light::Light;
// pub use scene::Scene;
pub use shadow_mapping::ShadowMapping;
// pub use properties::Properties;
pub use ttf::Ttf;
pub use bitmap_font::BitmapFont;
pub use ambient_light::AmbientLight;
pub use image_based_light::ImageBasedLight;
pub use skybox::Skybox;
pub use simple_fbo::SimpleFbo;
pub use object::Object;

#[macro_use]
pub mod renderer;
#[macro_use] pub mod macros;
pub mod vao_mesh;
pub mod vao_path;
// pub mod object;
pub mod material;
pub mod basic_material;
mod shader_material;
pub mod pbr_material;
pub mod outline_material;
pub mod pointlight;
pub mod directional_light;
pub mod spot_light;
mod ambient_light;
pub mod image_based_light;
mod light;
// pub mod scene;
pub mod shadow_mapping;
// mod properties;
pub mod traits;
pub mod cubemap;
pub mod ttf;
mod bitmap_font;
pub mod autoload;
mod skybox;
mod simple_fbo;
pub mod object;

#[cfg(feature = "gles")]
mod gl{
    pub use glcrate::*;

    pub const TEXTURE_MAX_ANISOTROPY_EXT: u32 = 0x84FE;
    pub const MAX_TEXTURE_MAX_ANISOTROPY_EXT: u32 = 0x84FF;

    pub static LUMINANCE: types::GLenum = 0x1909;
    pub static LUMINANCE_ALPHA: types::GLenum = 0x190A;
}

use std::collections::HashMap;
pub fn default_attribute_bindings() -> HashMap<String, u32>{
    vec![
        ("position".to_string(), 0),
        ("color".to_string(), 1),
        ("texcoord".to_string(), 2),
        ("normal".to_string(), 3),
    ].into_iter().collect()
}