Struct asi_opengl::OpenGL
[−]
[src]
pub struct OpenGL { /* fields omitted */ }
The OpenGL context.
Methods
impl OpenGL
[src]
pub fn clear(&self)
[src]
Clear the screen with a specific color.
pub fn color(&self, r: f32, g: f32, b: f32)
[src]
Set the color for clear
.
pub fn update(&self)
[src]
Update the screen
pub fn enable(&self, what: u32)
[src]
Enable something
pub fn disable(&self, what: u32)
[src]
Disable something
pub fn blend(&self)
[src]
Configure blending
pub fn shader(&self, vertex: &[u8], fragment: &[u8]) -> u32
[src]
Load a shader program
pub fn uniform(&self, shader: u32, name: &[u8]) -> i32
[src]
Get uniform from a shader.
pub fn attribute(&self, shader: u32, name: &[u8]) -> Attribute
[src]
Get the attribute
pub fn new_buffers(&self, n: usize) -> Vec<u32>
[src]
Create some new buffers
pub fn bind_buffer(&self, is_index_buffer: bool, buffer: u32)
[src]
Bind a buffer from new_buffers()
pub fn set_buffer<T>(&self, is_index_buffer: bool, data: &[T])
[src]
Set the bound buffer's data
pub fn use_program(&self, shader: u32)
[src]
Use a program.
pub fn set_mat4(&self, uniform: i32, mat4: &[f32; 16])
[src]
Set a mat4 uniform
pub fn set_int1(&self, uniform: i32, int1: i32)
[src]
Set an int uniform
pub fn set_vec1(&self, uniform: i32, vec1: f32)
[src]
Set a float uniform
pub fn set_vec2(&self, uniform: i32, vec: &[f32; 2])
[src]
Set a vec2 uniform
pub fn set_vec3(&self, uniform: i32, vec: &[f32; 3])
[src]
Set a vec3 uniform
pub fn set_vec4(&self, uniform: i32, vec: &[f32; 4])
[src]
Set a vec4 uniform
pub fn draw_elements(&self, n_indices: u32)
[src]
Draw the elements.
pub fn new_texture(&self) -> Texture
[src]
Create a new texture.
pub fn set_texture(&self, w: u32, h: u32, px: &[u32])
[src]
Set the bound texture's pixels
pub fn texture_update(&self, w: u32, h: u32, px: &[u32])
[src]
Update the pixels of an already bound & set texture.
pub fn use_texture(&self, texture: &Texture)
[src]
Use a texture.
pub fn vertex_attrib(&self, attrib: &Attribute)
[src]
Set vertex attribute to current buffer.
pub fn viewport(&self, w: u32, h: u32)
[src]
Update the viewport.