🚨 Fix clippy warnings
parent
a41eb8b969
commit
c4d6243d15
|
@ -2,8 +2,6 @@ use glam::{Mat4, Vec3, Vec4};
|
|||
|
||||
use sdl2::event::Event;
|
||||
use sdl2::keyboard::{Keycode, Scancode};
|
||||
use std::collections::HashMap;
|
||||
use std::ffi::{c_void};
|
||||
use std::time::{Duration};
|
||||
|
||||
use opengl_rust::*;
|
||||
|
@ -107,10 +105,7 @@ fn main () {
|
|||
.unwrap ();
|
||||
|
||||
gl::load_with (|s| {
|
||||
let result = video_subsystem.gl_get_proc_address (s) as *const _;
|
||||
//println! ("{:?}", result);
|
||||
|
||||
result
|
||||
video_subsystem.gl_get_proc_address (s) as *const _
|
||||
});
|
||||
|
||||
assert! (gl::ClearColor::is_loaded ());
|
||||
|
@ -160,8 +155,6 @@ fn main () {
|
|||
|
||||
let renderable_sky = glezz::RenderableModel::from_iqm (&sky_model);
|
||||
|
||||
const FALSE_U8: u8 = 0;
|
||||
|
||||
glezz::enable_vertex_attrib_array (attrs ["pos"]);
|
||||
glezz::enable_vertex_attrib_array (attrs ["uv"]);
|
||||
glezz::enable_vertex_attrib_array (attrs ["normal"]);
|
||||
|
@ -256,7 +249,7 @@ fn main () {
|
|||
|
||||
window.gl_swap_window ();
|
||||
|
||||
::std::thread::sleep (Duration::from_millis (15));
|
||||
std::thread::sleep (Duration::from_millis (15));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use crate::iqm;
|
|||
|
||||
pub fn clear_color (r: f32, g: f32, b: f32, a: f32) {
|
||||
unsafe {
|
||||
gl::ClearColor (1.0f32, 1.0f32, 1.0f32, 1.0f32);
|
||||
gl::ClearColor (r, g, b, a);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ impl VertexBuffer {
|
|||
gl::GenBuffers (1, &mut id);
|
||||
gl::BindBuffer (gl::ARRAY_BUFFER, id);
|
||||
|
||||
gl::BufferData (gl::ARRAY_BUFFER, (slice.len () * 4).try_into ().unwrap (), &slice [0] as *const f32 as *const c_void, gl::STATIC_DRAW);
|
||||
gl::BufferData (gl::ARRAY_BUFFER, (slice.len () * FLOAT_SIZE).try_into ().unwrap (), &slice [0] as *const f32 as *const c_void, gl::STATIC_DRAW);
|
||||
}
|
||||
assert! (id != 0);
|
||||
id
|
||||
|
|
|
@ -6,7 +6,7 @@ use nom::{
|
|||
|
||||
use std::convert::TryInto;
|
||||
|
||||
mod consts {
|
||||
pub mod consts {
|
||||
pub const VERSION: usize = 0;
|
||||
pub const FILESIZE: usize = 1;
|
||||
pub const FLAGS: usize = 2;
|
||||
|
|
|
@ -56,7 +56,7 @@ impl Drop for Texture {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
gl::DeleteTextures (1, &mut self.id);
|
||||
gl::DeleteTextures (1, &self.id);
|
||||
}
|
||||
|
||||
self.id = 0;
|
||||
|
|
Loading…
Reference in New Issue