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
101
102
103
104
105
106
//! # Lux

#![warn(missing_docs)]

#[macro_use]
extern crate glium;

extern crate glutin;
extern crate vecmath;
extern crate image;
extern crate num;
extern crate clock_ticks;
extern crate poison_pool;

mod private;

pub use private::types;

pub use private::error::{LuxError, LuxResult};

pub mod color {
    //! Color creation functions and some named defaults.

    pub use private::color::{Color, rgb, rgba, hsv, hsva, hex_rgb, hex_rgba};
    pub use private::colors::*;
}

pub mod graphics {
    //! All of 2d graphics related functionality.
    //!
    //! Most of the methods that actually let you draw things are defined in two main traits:
    //! `Canvas` and `PrimitiveCanvas`.
    //!
    //! The two objects that can be drawn to are are `Frame` and
    //! `DrawableTexture`.

    pub use private::canvas::{Canvas, Rectangle, Ellipse, ContainedSprite};
    pub use private::gfx_integration::{ColorVertex, TexVertex};
    pub use private::primitive_canvas::{PrimitiveCanvas, StencilType};
    pub use private::sprite::{
        IntoSprite,
        Sprite,
        Texture,
        DrawableTexture,
        UniformSpriteSheet,
        NonUniformSpriteSheet,
        TextureLoader
    };
    pub use glium::index::PrimitiveType;
    pub use glium::index::PrimitiveType::*;
}

pub mod interactive {
    //! Functionality for dealing with events, querying, and  modifying
    //! the window.

    pub use private::interactive::{
        keycodes,
        EventIterator,
        Event,
        MouseButton,
        Interactive,
        AbstractKey
    };
}

pub mod window {
    //! The main window and the frames that are generated by the window.
    //!
    //! The window is created by the Glutin library.

    pub use private::glutin_window::{Window, Frame, WindowOptions};
}

pub mod modifiers {
    //! Many contexts can be modified and chained together in a logical way.

    pub use private::raw::{Colored, Transform};
}

pub mod game {
    //! A game loop implementation using Lux for windowing and graphics.
    //!
    //! While the majority of the Lux API is mostly agnostic to the way that
    //! you structure your app, this module contains structure and a game loop
    //! implementation

    pub use private::game::{Game, GameRunner, Loader};
}

pub mod prelude {
    //! A collection of common traits, structs and functions that are
    //! recommended for average Lux usage.

    pub use color::{Color, rgb, rgba, hsv, hsva};
    pub use graphics::{Canvas, IntoSprite, Sprite, Texture};
    pub use interactive::Interactive;
    pub use window::{Window, Frame};
    pub use interactive::EventIterator;
    pub use modifiers::{Colored, Transform};
    //pub use font::{TextDraw};
    pub use graphics::TextureLoader;

    pub use LuxError;
    pub use LuxResult;
}