diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-05-01 09:22:01 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-05-01 09:22:01 +0200 |
commit | c755e10089613f95604f7867e13dbc0eb9af549b (patch) | |
tree | e2ed798787f0ea6cdfc9a06b4899c490f867bd71 /examples | |
parent | 10af3ca8b4102641017d94440280ca87b347b0dd (diff) | |
parent | 2f9272e1cb9dbe5d86369b04e1d45392bb91646b (diff) | |
download | glutin-c755e10089613f95604f7867e13dbc0eb9af549b.tar.gz glutin-c755e10089613f95604f7867e13dbc0eb9af549b.zip |
Merge pull request #415 from tomaka/fix-gles-supprt
Fix the GLES code in examples/support/mod.rs
Diffstat (limited to 'examples')
-rw-r--r-- | examples/support/mod.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/support/mod.rs b/examples/support/mod.rs index 329bd4b..ac41239 100644 --- a/examples/support/mod.rs +++ b/examples/support/mod.rs @@ -53,6 +53,8 @@ impl Context { #[cfg(target_os = "android")] pub fn draw_frame(&self, color: (f32, f32, f32, f32)) { + use std::mem; + unsafe { self.gl.ClearColor(color.0, color.1, color.2, color.3); self.gl.Clear(gl::COLOR_BUFFER_BIT); @@ -60,13 +62,10 @@ impl Context { self.gl.EnableClientState(gl::VERTEX_ARRAY); self.gl.EnableClientState(gl::COLOR_ARRAY); - unsafe { - use std::mem; - self.gl.VertexPointer(2, gl::FLOAT, (mem::size_of::<f32>() * 5) as i32, - mem::transmute(VERTEX_DATA.as_slice().as_ptr())); - self.gl.ColorPointer(3, gl::FLOAT, (mem::size_of::<f32>() * 5) as i32, - mem::transmute(VERTEX_DATA.as_slice().as_ptr().offset(2))); - } + self.gl.VertexPointer(2, gl::FLOAT, (mem::size_of::<f32>() * 5) as i32, + mem::transmute(VERTEX_DATA.as_ptr())); + self.gl.ColorPointer(3, gl::FLOAT, (mem::size_of::<f32>() * 5) as i32, + mem::transmute(VERTEX_DATA.as_ptr().offset(2))); self.gl.DrawArrays(gl::TRIANGLES, 0, 3); self.gl.DisableClientState(gl::VERTEX_ARRAY); |