Struct WebGLRSProgram

Source
pub struct WebGLRSProgram<'ctx> { /* private fields */ }
Expand description

The WebGLRSProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). These are then linked into a usable program.

Implementations§

Source§

impl<'ctx> WebGLRSProgram<'ctx>

Source

pub fn delete(self)

Deletes this WebGLRSProgram object. This method has no effect if the program has already been deleted.

Source

pub fn detach_shader(&self, shader: &WebGLRSShader<'_>)

Detaches a previously attached WebGLRSShader from this WebGLRSProgram.

§Arguments
  • shader - shader to detach
Source

pub fn attach_shader(&self, shader: &WebGLRSShader<'_>)

Attaches a WebGLRSShader to this WebGLRSProgram.

§Arguments
  • shader - shader to attach
Source

pub fn bind_attrib_location(&self, index: u32, name: &str)

Binds a generic vertex index to an attribute variable for this WebGLRSProgram

§Arguments
  • index - specifying the index of the generic vertex to bind.
  • name - specifying the name of the variable to bind to the generic vertex index. This name cannot start with “webgl_” or “webgl”, as these are reserved for use by WebGL.
Source

pub fn info_log(&self) -> String

Returns the information log for this WebGLRSProgram object. It contains errors that occurred during failed linking or validation of this object.

Source

pub fn is_valid(&self) -> bool

Returns true if this WebGLRSProgram is valid, false otherwise.

Links this WebGLRSProgram to the attached vertex and fragment shaders.

Source

pub fn enable(&self)

Sets this WebGLRSProgram as part of the current rendering state.

Source

pub fn validate(&self)

Validates this WebGLRSProgram. Checks if it is successfully linked and if it can be used in the current WebGL state.

Source

pub fn active_attrib(&self, index: u32) -> WebGLActiveInfo

Returns a WebGLActiveInfo object containing size, type, and name of a vertex attribute.

It is generally used when querying unknown uniforms either for debugging or generic library creation.

§Arguments
  • index - specifying the index of the vertex attribute to get.
Source

pub fn active_uniform(&self, index: u32) -> WebGLActiveInfo

Returns a WebGLActiveInfo object containing size, type, and name of a uniform attribute.

It is generally used when querying unknown uniforms either for debugging or generic library creation.

§Arguments
  • index - specifying the index of the vertex attribute to get.
Source

pub fn attrib_location(&self, name: &str) -> u32

Returns the location of an attribute variable in this WebGLRSProgram.

§Arguments
  • name - specifying the name of the attribute variable whose location to get.
Source

pub fn uniform_location(&self, name: &str) -> WebGLRSUniformLocation<'_>

Returns the location of a specific uniform variable which is part this WebGLRSProgram.

The uniform variable is returned as a WebGLUniformLocation object, which is an opaque identifier used to specify where in the GPU’s memory that uniform variable is located.

§Arguments
  • name- specifying the name of the uniform variable whose location is to be returned. The name can’t have any whitespace in it, and you can’t use this function to get the location of any uniforms starting with the reserved string “gl_”, since those are internal to the WebGL layer.
Source

pub fn frag_data_location(&self, name: &str) -> i32

Returns the binding of color numbers to user-defined varying out variables.

§Arguments
  • name - specifying the name of the user-defined varying out variable.
Source

pub fn transform_feedback_varying(&self, index: u32) -> WebGLActiveInfo

Returns information about varying variables from WebGLTransformFeedback buffers.

§Arguments
  • index - specifying the index of the varying variable whose information to retrieve.
Source

pub fn uniform_block_index(&self, uniform_block_name: &str) -> u32

Retrieves the index of a uniform block in this WebGLRSProgram.

§Arguments
  • uniform_block_name - specifying the name of the uniform block to whose index to retrieve.
Source

pub fn active_uniform_block_name(&self, uniform_block_index: u32) -> String

Retrieves the name of the active uniform block at a given index in this WebGLRSProgram.

§Arguments
  • uniform_block_index - specifying the index of the uniform block to whose name to retrieve.
Source

pub fn assign_uniform_block_binding( &self, uniform_block_index: u32, uniform_block_binding: u32, )

Asigns binding points for active uniform blocks.

§Arguments
  • uniform_block_index - specifying the index of the active uniform block within the program.
  • uniform_block_binding - specifying the binding point to which to bind the uniform block.
Source

pub fn delete_status(&self) -> bool

Indicates whether or not the program is flagged for deletion.

Indicates whether or not the last link operation was successful.

Source

pub fn validate_status(&self) -> bool

Indicates whether or not the last validation operation was successful.

Source

pub fn attached_shaders(&self) -> i32

Returns the number of attached shaders to a program.

Source

pub fn active_attributes(&self) -> i32

Returns the number of active attribute variables to a program.

Source

pub fn active_uniforms(&self) -> i32

Returns the number of active uniform variables to a program.

Source

pub fn transform_feedback_buffer_mode(&self) -> TransformFeedbackBufferMode

Returns the buffer mode when transform feedback is active. May be SeparateAttribs or InterleavedAttribs.

Source

pub fn transform_feedback_varyings(&self) -> i32

Returns the number of varying variables to capture in transform feedback mode.

Source

pub fn active_uniform_blocks(&self) -> i32

Trait Implementations§

Source§

impl<'ctx> Clone for WebGLRSProgram<'ctx>

Source§

fn clone(&self) -> WebGLRSProgram<'ctx>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'ctx> Freeze for WebGLRSProgram<'ctx>

§

impl<'ctx> RefUnwindSafe for WebGLRSProgram<'ctx>

§

impl<'ctx> !Send for WebGLRSProgram<'ctx>

§

impl<'ctx> !Sync for WebGLRSProgram<'ctx>

§

impl<'ctx> Unpin for WebGLRSProgram<'ctx>

§

impl<'ctx> UnwindSafe for WebGLRSProgram<'ctx>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.