Fix doc tests

This commit is contained in:
shivshank 2019-04-21 21:40:30 -04:00
parent 2570ce152a
commit 1dd829a8ed
2 changed files with 16 additions and 3 deletions

View file

@ -2,13 +2,15 @@
/// ///
/// The following pattern is reccomended when creating a config: /// The following pattern is reccomended when creating a config:
/// ///
/// ```rust /// ```
/// let config = Config { /// use mini_gl_fb::Config;
///
/// let config: Config<&str> = Config {
/// /* specify whichever fields you need to set, for example: */ /// /* specify whichever fields you need to set, for example: */
/// window_size: (100.0, 100.0), /// window_size: (100.0, 100.0),
/// resizable: false, /// resizable: false,
/// .. Default::default() /// .. Default::default()
/// } /// };
/// ``` /// ```
/// ///
/// If there's a config option you want to see or think is missing, please open an issue! /// If there's a config option you want to see or think is missing, please open an issue!

View file

@ -39,6 +39,11 @@
//! you to, for instance, create a window with a buffer of a different size than the window. //! you to, for instance, create a window with a buffer of a different size than the window.
//! //!
//! ```rust //! ```rust
//! use mini_gl_fb::{get_fancy, Config};
//! # let window_title = "foo";
//! # let window_width = 800.0;
//! # let window_height = 600.0;
//!
//! let config = Config { //! let config = Config {
//! window_title: window_title.to_string(), //! window_title: window_title.to_string(),
//! window_size: (window_width, window_height), //! window_size: (window_width, window_height),
@ -199,6 +204,8 @@ impl MiniGlFb {
/// The behavior of the default fragment shader can be emulated by the following: /// The behavior of the default fragment shader can be emulated by the following:
/// ///
/// ```rust /// ```rust
/// # use mini_gl_fb::get_fancy;
/// # let mut fb = get_fancy::<&str>(Default::default());
/// fb.use_post_process_shader(" /// fb.use_post_process_shader("
/// void main_image( out vec4 r_frag_color, in vec2 v_uv ) { /// void main_image( out vec4 r_frag_color, in vec2 v_uv ) {
/// r_frag_color = texture(u_buffer, v_uv); /// r_frag_color = texture(u_buffer, v_uv);
@ -242,6 +249,10 @@ impl MiniGlFb {
/// # Example /// # Example
/// ///
/// ```rust /// ```rust
/// use mini_gl_fb::BufferFormat;
/// # use mini_gl_fb::get_fancy;
/// # let mut fb = get_fancy::<&str>(Default::default());
///
/// fb.change_buffer_format::<u8>(BufferFormat::R); /// fb.change_buffer_format::<u8>(BufferFormat::R);
/// fb.use_grayscale_shader(); /// fb.use_grayscale_shader();
/// ``` /// ```