Struct three_d::core::Context [−][src]
pub struct Context { /* fields omitted */ }
Expand description
Contains information about the graphics context to use for rendering and other “global” variables.
Implementations
Creates a new context from a OpenGL/WebGL context.
pub fn program(
&self,
vertex_shader_source: &str,
fragment_shader_source: &str,
callback: impl FnOnce(&Program) -> ThreeDResult<()>
) -> ThreeDResult<()>
pub fn program(
&self,
vertex_shader_source: &str,
fragment_shader_source: &str,
callback: impl FnOnce(&Program) -> ThreeDResult<()>
) -> ThreeDResult<()>
Compiles a Program with the given vertex and fragment shader source and stores it for later use. If it has already been created, then it is just returned.
pub fn effect(
&self,
fragment_shader_source: &str,
callback: impl FnOnce(&ImageEffect) -> ThreeDResult<()>
) -> ThreeDResult<()>
pub fn effect(
&self,
fragment_shader_source: &str,
callback: impl FnOnce(&ImageEffect) -> ThreeDResult<()>
) -> ThreeDResult<()>
Compiles an ImageEffect with the given fragment shader source and stores it for later use. If it has already been created, then it is just returned.
pub fn camera2d(
&self,
viewport: Viewport,
callback: impl FnOnce(&Camera) -> ThreeDResult<()>
) -> ThreeDResult<()>
pub fn camera2d(
&self,
viewport: Viewport,
callback: impl FnOnce(&Camera) -> ThreeDResult<()>
) -> ThreeDResult<()>
Returns a camera for viewing 2D content.
Creates a new headless graphics context (a graphics context that is not associated with any window).
Methods from Deref<Target = GLContext>
pub fn vertex_attrib_pointer(
&self,
location: AttributeLocation,
size: u32,
data_type: DataType,
normalized: bool,
stride: u32,
offset: u32
)
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
)
pub fn tex_storage_2d(
&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
)
pub fn tex_image_2d(
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
border: u32,
format: u32,
data_type: DataType
)
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: DataType,
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: DataType,
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: DataType,
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: DataType,
pixels: &[f32]
)
pub fn tex_sub_image_2d_with_u16_data(
&self,
target: u32,
level: u32,
x_offset: u32,
y_offset: u32,
width: u32,
height: u32,
format: u32,
data_type: DataType,
pixels: &[u16]
)
pub fn tex_sub_image_2d_with_u32_data(
&self,
target: u32,
level: u32,
x_offset: u32,
y_offset: u32,
width: u32,
height: u32,
format: u32,
data_type: DataType,
pixels: &[u32]
)
pub fn tex_image_3d(
&self,
target: u32,
level: u32,
internalformat: u32,
width: u32,
height: u32,
depth: u32,
format: u32,
data_type: DataType
)
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: DataType,
pixels: &[u16]
)
pub fn framebuffer_texture_2d(
&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
)
pub fn draw_elements_instanced(
&self,
mode: u32,
count: u32,
data_type: DataType,
offset: u32,
instance_count: u32
)
pub fn read_pixels_with_u8_data(
&self,
x: u32,
y: u32,
width: u32,
height: u32,
format: u32,
data_type: DataType,
dst_data: &mut [u8]
)
pub fn read_pixels_with_u16_data(
&self,
x: u32,
y: u32,
width: u32,
height: u32,
format: u32,
data_type: DataType,
dst_data: &mut [u16]
)
pub fn read_pixels_with_f32_data(
&self,
x: u32,
y: u32,
width: u32,
height: u32,
format: u32,
data_type: DataType,
dst_data: &mut [f32]
)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Context
impl !UnwindSafe for Context
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more