Skip to content

Commit

Permalink
Moved 'c_str' func from misc.rs to gl_helpers.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
ozkriff committed Feb 19, 2014
1 parent 7ee610e commit b61d286
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 6 additions & 1 deletion gl_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use cgmath::vector::{
use cgmath::angle;
use stb_image::image;
use misc::{
c_str,
deg_to_rad,
};
use gl_types::{
Expand All @@ -38,6 +37,12 @@ use gl_types::{
};
use core_types::Int;

fn c_str(s: &str) -> *GLchar {
unsafe {
s.to_c_str().unwrap()
}
}

pub fn compile_shader(src: &str, shader_type: GLenum) -> GLuint {
let shader = gl::CreateShader(shader_type);
unsafe {
Expand Down
7 changes: 0 additions & 7 deletions misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@
use std::f32::consts::PI;
use std::io::File;
use std::str::from_utf8_owned;
use gl::types::GLchar;
use gl_types::Float;

pub fn c_str(s: &str) -> *GLchar {
unsafe {
s.to_c_str().unwrap()
}
}

pub fn deg_to_rad(n: Float) -> Float {
n * PI / 180.0
}
Expand Down

0 comments on commit b61d286

Please sign in to comment.