From 225416353f2eb56fe55b732b8f3f82c7e2595714 Mon Sep 17 00:00:00 2001 From: Ryan Kennedy Date: Wed, 25 Mar 2020 20:01:35 -0500 Subject: [PATCH] 320x200x256 additions --- Cargo.toml | 2 +- Changelog.md | 5 +++++ src/writers/graphics_320x200x256.rs | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 16ba9b4..5d2e8ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vga" -version = "0.2.0" +version = "0.2.1" authors = ["Ryan Kennedy "] edition = "2018" description = "Support for vga specific functions, data structures, and registers." diff --git a/Changelog.md b/Changelog.md index 0ed738d..52d60e3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,8 @@ +# 0.2.1 + +- Added `Graphics320x200x256` mode. +- Implemented `Screen` for `Graphics640x480x16`. + # 0.2.0 ## Breaking diff --git a/src/writers/graphics_320x200x256.rs b/src/writers/graphics_320x200x256.rs index 30a3983..93e6f2f 100644 --- a/src/writers/graphics_320x200x256.rs +++ b/src/writers/graphics_320x200x256.rs @@ -12,6 +12,27 @@ const HEIGHT: usize = 200; const SIZE: usize = WIDTH * HEIGHT; /// A basic interface for interacting with vga graphics mode 320x200x256. +/// +/// # Examples +/// +/// Basic usage: +/// +/// ```no_run +/// use vga::colors::Color16; +/// use vga::writers::{Graphics320x200x256, GraphicsWriter}; + +/// let mode = Graphics320x200x256::new(); +/// mode.set_mode(); +/// mode.clear_screen(0); +/// mode.draw_line((60, 20), (260, 20), 255); +/// mode.draw_line((60, 20), (60, 180), 255); +/// mode.draw_line((60, 180), (260, 180), 255); +/// mode.draw_line((260, 180), (260, 20), 255); +/// mode.draw_line((60, 40), (260, 40), 255); +/// for (offset, character) in "Hello World!".chars().enumerate() { +/// mode.draw_character(118 + offset * 8, 27, character, 255); +/// } +/// ``` #[derive(Default)] pub struct Graphics320x200x256 {}