Struct three_d::Context [−][src]
pub struct Context { /* fields omitted */ }
Expand description
Contains the graphics API for almost direct calls to OpenGL/WebGL. Used internally in the higher level features and can safely be ignored unless you want more control.
Calls to this API can be combined with higher level features.
Implementations
impl Context
[src]
impl Context
[src]pub fn load_with<F>(loadfn: F) -> Context where
F: FnMut(&'r str) -> *const GLvoid,
[src]
F: FnMut(&'r str) -> *const GLvoid,
pub fn finish(&self)
[src]
pub fn create_shader(&self, type_: u32) -> Option<Shader>
[src]
pub fn compile_shader(&self, source: &str, shader: &Shader)
[src]
pub fn get_shader_info_log(&self, shader: &Shader) -> Option<String>
[src]
pub fn delete_shader(&self, shader: Option<&Shader>)
[src]
pub fn attach_shader(&self, program: &Program, shader: &Shader)
[src]
pub fn detach_shader(&self, program: &Program, shader: &Shader)
[src]
pub fn get_program_parameter(&self, program: &Program, pname: u32) -> u32
[src]
pub fn get_active_attrib(&self, program: &Program, index: u32) -> ActiveInfo
[src]
pub fn get_active_uniform(&self, program: &Program, index: u32) -> ActiveInfo
[src]
pub fn create_buffer(&self) -> Option<Buffer>
[src]
pub fn delete_buffer(&self, buffer: &Buffer)
[src]
pub fn bind_buffer_base(&self, target: u32, index: u32, buffer: &Buffer)
[src]
pub fn bind_buffer(&self, target: u32, buffer: &Buffer)
[src]
pub fn unbind_buffer(&self, target: u32)
[src]
pub fn get_uniform_block_index(&self, program: &Program, name: &str) -> u32
[src]
pub fn uniform_block_binding(
&self,
program: &Program,
location: u32,
index: u32
)
[src]
&self,
program: &Program,
location: u32,
index: u32
)
pub fn buffer_data(&self, target: u32, size_in_bytes: u32, usage: u32)
[src]
pub fn buffer_data_u8(&self, target: u32, data: &[u8], usage: u32)
[src]
pub fn buffer_data_u32(&self, target: u32, data: &[u32], usage: u32)
[src]
pub fn buffer_data_f32(&self, target: u32, data: &[f32], usage: u32)
[src]
pub fn create_vertex_array(&self) -> Option<VertexArrayObject>
[src]
pub fn bind_vertex_array(&self, array: &VertexArrayObject)
[src]
pub fn create_program(&self) -> Program
[src]
pub fn link_program(&self, program: &Program) -> bool
[src]
pub fn get_program_info_log(&self, program: &Program) -> Option<String>
[src]
pub fn use_program(&self, program: &Program)
[src]
pub fn unuse_program(&self)
[src]
pub fn delete_program(&self, program: &Program)
[src]
pub fn get_attrib_location(
&self,
program: &Program,
name: &str
) -> Option<AttributeLocation>
[src]
&self,
program: &Program,
name: &str
) -> Option<AttributeLocation>
pub fn enable_vertex_attrib_array(&self, location: AttributeLocation)
[src]
pub fn disable_vertex_attrib_array(&self, location: AttributeLocation)
[src]
pub fn vertex_attrib_pointer(
&self,
location: AttributeLocation,
size: u32,
data_type: u32,
normalized: bool,
stride: u32,
offset: u32
)
[src]
&self,
location: AttributeLocation,
size: u32,
data_type: u32,
normalized: bool,
stride: u32,
offset: u32
)
pub fn vertex_attrib_divisor(&self, location: AttributeLocation, divisor: u32)
[src]
pub fn get_uniform_location(
&self,
program: &Program,
name: &str
) -> Option<UniformLocation>
[src]
&self,
program: &Program,
name: &str
) -> Option<UniformLocation>
pub fn uniform1i(&self, location: &UniformLocation, data: i32)
[src]
pub fn uniform1f(&self, location: &UniformLocation, data: f32)
[src]
pub fn uniform2fv(&self, location: &UniformLocation, data: &[f32])
[src]
pub fn uniform3fv(&self, location: &UniformLocation, data: &[f32])
[src]
pub fn uniform4fv(&self, location: &UniformLocation, data: &[f32])
[src]
pub fn uniform_matrix2fv(&self, location: &UniformLocation, data: &[f32])
[src]
pub fn uniform_matrix3fv(&self, location: &UniformLocation, data: &[f32])
[src]
pub fn uniform_matrix4fv(&self, location: &UniformLocation, data: &[f32])
[src]
pub fn draw_buffers(&self, draw_buffers: &[u32])
[src]
pub fn create_framebuffer(&self) -> Option<Framebuffer>
[src]
pub fn bind_framebuffer(&self, target: u32, framebuffer: Option<&Framebuffer>)
[src]
pub fn delete_framebuffer(&self, framebuffer: Option<&Framebuffer>)
[src]
pub fn check_framebuffer_status(&self) -> Result<(), String>
[src]
pub fn blit_framebuffer(
&self,
src_x0: u32,
src_y0: u32,
src_x1: u32,
src_y1: u32,
dst_x0: u32,
dst_y0: u32,
dst_x1: u32,
dst_y1: u32,
mask: u32,
filter: u32
)
[src]
&self,
src_x0: u32,
src_y0: u32,
src_x1: u32,
src_y1: u32,
dst_x0: u32,
dst_y0: u32,
dst_x1: u32,
dst_y1: u32,
mask: u32,
filter: u32
)
pub fn viewport(&self, x: i32, y: i32, width: usize, height: usize)
[src]
pub fn clear_color(&self, red: f32, green: f32, blue: f32, alpha: f32)
[src]
pub fn clear_depth(&self, depth: f32)
[src]
pub fn clear(&self, mask: u32)
[src]
pub fn enable(&self, cap: u32)
[src]
pub fn disable(&self, cap: u32)
[src]
pub fn blend_func(&self, sfactor: u32, dfactor: u32)
[src]
pub fn blend_func_separate(
&self,
src_rgb: u32,
dst_rgb: u32,
src_alpha: u32,
dst_alpha: u32
)
[src]
&self,
src_rgb: u32,
dst_rgb: u32,
src_alpha: u32,
dst_alpha: u32
)
pub fn blend_equation(&self, mode: u32)
[src]
pub fn blend_equation_separate(&self, mode_rgb: u32, mode_alpha: u32)
[src]
pub fn cull_face(&self, mode: u32)
[src]
pub fn depth_func(&self, func: u32)
[src]
pub fn color_mask(&self, red: bool, green: bool, blue: bool, alpha: bool)
[src]
pub fn depth_mask(&self, flag: bool)
[src]
pub fn create_texture(&self) -> Option<Texture>
[src]
pub fn active_texture(&self, texture: u32)
[src]
pub fn bind_texture(&self, target: u32, texture: &Texture)
[src]
pub fn generate_mipmap(&self, target: u32)
[src]
pub fn tex_storage_2d(
&self,
target: u32,
levels: u32,
internalformat: u32,
width: u32,
height: u32
)
[src]
&self,
target: u32,
levels: u32,
internalformat: u32,
width: u32,
height: u32
)
pub fn tex_storage_3d(
&self,
target: u32,
levels: u32,
internalformat: u32,
width: u32,
height: u32,
depth: u32
)
[src]
&self,
target: u32,
levels: u32,
internalformat: u32,
width: u32,
height: u32,
depth: u32
)
pub fn tex_image_2d(
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
border: u32,
format: u32,
data_type: u32
)
[src]
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
border: u32,
format: u32,
data_type: u32
)
pub fn tex_image_2d_with_u8_data(
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
border: u32,
format: u32,
data_type: u32,
pixels: &[u8]
)
[src]
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
border: u32,
format: u32,
data_type: u32,
pixels: &[u8]
)
pub fn tex_sub_image_2d_with_u8_data(
&self,
target: u32,
level: u32,
x_offset: u32,
y_offset: u32,
width: u32,
height: u32,
format: u32,
data_type: u32,
pixels: &[u8]
)
[src]
&self,
target: u32,
level: u32,
x_offset: u32,
y_offset: u32,
width: u32,
height: u32,
format: u32,
data_type: u32,
pixels: &[u8]
)
pub fn tex_image_2d_with_f32_data(
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
border: u32,
format: u32,
data_type: u32,
pixels: &[f32]
)
[src]
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
border: u32,
format: u32,
data_type: u32,
pixels: &[f32]
)
pub fn tex_sub_image_2d_with_f32_data(
&self,
target: u32,
level: u32,
x_offset: u32,
y_offset: u32,
width: u32,
height: u32,
format: u32,
data_type: u32,
pixels: &[f32]
)
[src]
&self,
target: u32,
level: u32,
x_offset: u32,
y_offset: u32,
width: u32,
height: u32,
format: u32,
data_type: u32,
pixels: &[f32]
)
pub fn tex_image_3d(
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
depth: u32,
format: u32,
data_type: u32
)
[src]
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
depth: u32,
format: u32,
data_type: u32
)
pub fn tex_image_3d_with_u16_data(
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
depth: u32,
border: u32,
format: u32,
data_type: u32,
pixels: &[u16]
)
[src]
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
depth: u32,
border: u32,
format: u32,
data_type: u32,
pixels: &[u16]
)
pub fn tex_parameteri(&self, target: u32, pname: u32, param: i32)
[src]
pub fn delete_texture(&self, texture: &Texture)
[src]
pub fn framebuffer_texture_2d(
&self,
target: u32,
attachment: u32,
textarget: u32,
texture: &Texture,
level: u32
)
[src]
&self,
target: u32,
attachment: u32,
textarget: u32,
texture: &Texture,
level: u32
)
pub fn framebuffer_texture_layer(
&self,
target: u32,
attachment: u32,
texture: &Texture,
level: u32,
layer: u32
)
[src]
&self,
target: u32,
attachment: u32,
texture: &Texture,
level: u32,
layer: u32
)
pub fn draw_arrays(&self, mode: u32, first: u32, count: u32)
[src]
pub fn draw_arrays_instanced(
&self,
mode: u32,
first: u32,
count: u32,
instance_count: u32
)
[src]
&self,
mode: u32,
first: u32,
count: u32,
instance_count: u32
)
pub fn draw_elements(&self, mode: u32, count: u32, data_type: u32, offset: u32)
[src]
pub fn draw_elements_instanced(
&self,
mode: u32,
count: u32,
data_type: u32,
offset: u32,
instance_count: u32
)
[src]
&self,
mode: u32,
count: u32,
data_type: u32,
offset: u32,
instance_count: u32
)
pub fn read_pixels(
&self,
x: u32,
y: u32,
width: u32,
height: u32,
format: u32,
data_type: u32
)
[src]
&self,
x: u32,
y: u32,
width: u32,
height: u32,
format: u32,
data_type: u32
)
pub fn read_pixels_with_u8_data(
&self,
x: u32,
y: u32,
width: u32,
height: u32,
format: u32,
data_type: u32,
dst_data: &mut [u8]
)
[src]
&self,
x: u32,
y: u32,
width: u32,
height: u32,
format: u32,
data_type: u32,
dst_data: &mut [u8]
)
pub fn read_pixels_with_f32_data(
&self,
x: u32,
y: u32,
width: u32,
height: u32,
format: u32,
data_type: u32,
dst_data: &mut [f32]
)
[src]
&self,
x: u32,
y: u32,
width: u32,
height: u32,
format: u32,
data_type: u32,
dst_data: &mut [f32]
)
pub fn flush(&self)
[src]
pub fn fence_sync(&self) -> Sync
[src]
pub fn client_wait_sync(&self, sync: &Sync, flags: u32, timeout: u32) -> u32
[src]
pub fn delete_sync(&self, sync: &Sync)
[src]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more