From 883b69f9c520c7215aa86559da109f09e3a122f7 Mon Sep 17 00:00:00 2001 From: shivshank Date: Fri, 24 Aug 2018 18:13:40 -0400 Subject: [PATCH] Be consistent with OpenGL coords, buffer[0] being the bottom left --- src/core.rs | 12 ++++++------ src/lib.rs | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core.rs b/src/core.rs index ab5f9a1..62450b9 100644 --- a/src/core.rs +++ b/src/core.rs @@ -99,12 +99,12 @@ pub fn init_framebuffer( VertexFormat::declare(0); let verts: [[f32; 2]; 12] = [ - [-1., 1.], [0., 0.], // top left - [-1., -1.], [0., 1.], // bottom left - [1., -1.], [1., 1.], // bottom right - [1., -1.], [1., 1.], // bottom right - [1., 1.], [1., 0.], // top right - [-1., 1.], [0., 0.], // top left + [-1., 1.], [0., 1.], // top left + [-1., -1.], [0., 0.], // bottom left + [1., -1.], [1., 0.], // bottom right + [1., -1.], [1., 0.], // bottom right + [1., 1.], [1., 1.], // top right + [-1., 1.], [0., 1.], // top left ]; use std::mem::size_of_val; gl::BufferData(gl::ARRAY_BUFFER, diff --git a/src/lib.rs b/src/lib.rs index 3e9b892..f603b10 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,7 +16,7 @@ //! } //! ``` //! -//! The default buffer format is 32bit RGBA, so every pixel is four bytes. Buffer[0] is the top +//! The default buffer format is 32bit RGBA, so every pixel is four bytes. Buffer[0] is the bottom //! left pixel. The buffer should be tightly packed with no padding after each row. //! //! # Interlude: Library philosophy @@ -213,8 +213,8 @@ impl MiniGlFb { /// /// The output color is determined by the value of the first output parameter, `r_frag_color`. /// Your buffer is accessible as a 2D sampler uniform named `u_buffer`. The first input - /// parameter `v_uv` is a vec2 UV coordinate. UV (0, 0) represents the upper left of the screen - /// and (1, 1) represents the bottom right. + /// parameter `v_uv` is a vec2 UV coordinate. UV (0, 0) represents the bottom left of the + /// screen and (1, 1) represents the top right. /// /// An API for exposing more built in and custom uniforms is planned, along with support for /// an arbitrary number of render targets and possibly more user supplied textures.