pub struct UniformJs(/* private fields */);Implementations§
Source§impl UniformJs
impl UniformJs
pub fn program_ids(&self) -> StringArray
pub fn uniform_id(&self) -> String
pub fn uniform_locations(&self) -> UniformLocationsMap
Source§impl UniformJs
impl UniformJs
pub fn into_inner(self) -> UniformJsInner
Methods from Deref<Target = UniformJsInner>§
Sourcepub fn program_ids(&self) -> &Vec<ProgramId>
pub fn program_ids(&self) -> &Vec<ProgramId>
Gets all program ids associated with this uniform
Sourcepub fn uniform_id(&self) -> &UniformId
pub fn uniform_id(&self) -> &UniformId
Gets this uniform’s uniform id
Sourcepub fn uniform_locations(&self) -> &HashMap<ProgramId, WebGlUniformLocation>
pub fn uniform_locations(&self) -> &HashMap<ProgramId, WebGlUniformLocation>
Gets this uniform’s location for all associated program ids
Sourcepub fn initialize_callback(&self) -> UniformCreateUpdateCallback
pub fn initialize_callback(&self) -> UniformCreateUpdateCallback
Gets the callback that is used to initialize this uniform
Sourcepub fn should_update_callback(&self) -> Option<UniformShouldUpdateCallback>
pub fn should_update_callback(&self) -> Option<UniformShouldUpdateCallback>
Gets the callback that is used to determine whether this uniform should update when crate::RendererData::update_uniform or crate::RendererData::update_uniforms is called.
Sourcepub fn update_callback(&self) -> Option<UniformCreateUpdateCallback>
pub fn update_callback(&self) -> Option<UniformCreateUpdateCallback>
Gets the callback that is used to updated this uniform whenever crate::RendererData::update_uniform or crate::RendererData::update_uniforms is called.
Sourcepub fn use_init_callback_for_update(&self) -> bool
pub fn use_init_callback_for_update(&self) -> bool
If set to true, Uniform will use the Uniform::initialize_callback callback
to update when crate::RendererData::update_uniform or crate::RendererData::update_uniforms is called
rather than the Uniform::update_callback
Sourcepub fn update(
&self,
gl: &WebGl2RenderingContext,
now: f64,
programs: &HashMap<ProgramId, WebGlProgram>,
)
pub fn update( &self, gl: &WebGl2RenderingContext, now: f64, programs: &HashMap<ProgramId, WebGlProgram>, )
Updates the value of this uniform in WebGl for every Program where this uniform is used, using the update callback that was passed in at creation time.
@todo: calling this function for anything more than the current program is useless without a UBO
Trait Implementations§
Source§impl DerefMut for UniformJs
impl DerefMut for UniformJs
Source§fn deref_mut(&mut self) -> &mut UniformJsInner
fn deref_mut(&mut self) -> &mut UniformJsInner
Source§impl From<&Uniform<String, String>> for UniformJs
impl From<&Uniform<String, String>> for UniformJs
Source§fn from(js_uniform_inner: &UniformJsInner) -> Self
fn from(js_uniform_inner: &UniformJsInner) -> Self
Source§impl From<Uniform<String, String>> for UniformJs
impl From<Uniform<String, String>> for UniformJs
Source§fn from(js_uniform_inner: UniformJsInner) -> Self
fn from(js_uniform_inner: UniformJsInner) -> Self
Source§impl From<UniformJs> for UniformJsInner
impl From<UniformJs> for UniformJsInner
Source§impl FromWasmAbi for UniformJs
impl FromWasmAbi for UniformJs
Source§impl IntoWasmAbi for UniformJs
impl IntoWasmAbi for UniformJs
Source§impl LongRefFromWasmAbi for UniformJs
impl LongRefFromWasmAbi for UniformJs
Source§impl OptionFromWasmAbi for UniformJs
impl OptionFromWasmAbi for UniformJs
Source§impl OptionIntoWasmAbi for UniformJs
impl OptionIntoWasmAbi for UniformJs
Source§impl RefFromWasmAbi for UniformJs
impl RefFromWasmAbi for UniformJs
Source§impl RefMutFromWasmAbi for UniformJs
impl RefMutFromWasmAbi for UniformJs
Source§impl TryFromJsValue for UniformJs
impl TryFromJsValue for UniformJs
Source§impl VectorFromWasmAbi for UniformJs
impl VectorFromWasmAbi for UniformJs
Source§impl VectorIntoWasmAbi for UniformJs
impl VectorIntoWasmAbi for UniformJs
impl SupportsConstructor for UniformJs
impl SupportsInstanceProperty for UniformJs
impl SupportsStaticProperty for UniformJs
Auto Trait Implementations§
impl Freeze for UniformJs
impl !RefUnwindSafe for UniformJs
impl !Send for UniformJs
impl !Sync for UniformJs
impl Unpin for UniformJs
impl !UnwindSafe for UniformJs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.