Example #1
0
 /// <summary>
 /// Sets a texture to use for drawing primitives.
 /// </summary>
 /// <param name="textureUnit">The texture unit to set.</param>
 /// <param name="sampler">The sampler uniform.</param>
 /// <param name="texture">The texture to set.</param>
 /// <param name="flags">Sampling flags that override the default flags in the texture itself.</param>
 public void SetTexture(byte textureUnit, Uniform sampler, Texture texture, TextureFlags flags)
 {
     NativeMethods.bgfx_encoder_set_texture(ptr, textureUnit, sampler.handle, texture.handle, (uint)flags);
 }
Example #2
0
 /// <summary>
 /// Sets the value of a uniform parameter.
 /// </summary>
 /// <param name="uniform">The uniform to set.</param>
 /// <param name="value">A pointer to the uniform's data.</param>
 /// <param name="arraySize">The size of the data array, if the uniform is an array.</param>
 public void SetUniform(Uniform uniform, IntPtr value, int arraySize = 1)
 {
     NativeMethods.bgfx_encoder_set_uniform(ptr, uniform.handle, value.ToPointer(), (ushort)arraySize);
 }
Example #3
0
 /// <summary>
 /// Sets a texture to use for drawing primitives.
 /// </summary>
 /// <param name="textureUnit">The texture unit to set.</param>
 /// <param name="sampler">The sampler uniform.</param>
 /// <param name="texture">The texture to set.</param>
 public void SetTexture(byte textureUnit, Uniform sampler, Texture texture)
 {
     NativeMethods.bgfx_encoder_set_texture(ptr, textureUnit, sampler.handle, texture.handle, uint.MaxValue);
 }
Example #4
0
 /// <summary>
 /// Sets the value of a uniform parameter.
 /// </summary>
 /// <param name="uniform">The uniform to set.</param>
 /// <param name="value">A pointer to the uniform's data.</param>
 /// <param name="arraySize">The size of the data array, if the uniform is an array.</param>
 public void SetUniform(Uniform uniform, void *value, int arraySize = 1)
 {
     NativeMethods.bgfx_encoder_set_uniform(ptr, uniform.handle, value, (ushort)arraySize);
 }