Feature alloc for graphics

This commit is contained in:
Ryan Kennedy 2020-03-29 17:27:46 -05:00
parent 689ecc7bf3
commit 57799a188b
3 changed files with 12 additions and 0 deletions

View file

@ -28,3 +28,10 @@ x86_64 = "0.9.6"
[dependencies.num-traits]
version = "0.2.11"
default-features = false
[features]
default = []
alloc = []
[package.metadata.docs.rs]
features = ["alloc"]

View file

@ -7,6 +7,7 @@
#![no_std]
#![warn(missing_docs)]
#[cfg(feature = "alloc")]
extern crate alloc;
pub mod colors;

View file

@ -1,5 +1,7 @@
//! Writers for common vga modes.
#[cfg(feature = "alloc")]
mod graphics_320x200x256;
#[cfg(feature = "alloc")]
mod graphics_640x480x16;
mod text_40x25;
mod text_40x50;
@ -11,7 +13,9 @@ use super::{
vga::VGA,
};
#[cfg(feature = "alloc")]
pub use graphics_320x200x256::Graphics320x200x256;
#[cfg(feature = "alloc")]
pub use graphics_640x480x16::Graphics640x480x16;
pub use text_40x25::Text40x25;
pub use text_40x50::Text40x50;