ZennoLab Assemblies Documentation
WebGLPreferences Class
Members  Example 
ZennoLab.CommandCenter Namespace : WebGLPreferences Class
Represents an WebGLContext settings object.
Syntax
public class WebGLPreferences 
Example
The following example uses the Set method.
// set Chrome useragent
instance.SetHeader(ZennoLab.InterfacesLibrary.Enums.Browser.NavigatorField.UserAgent, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36");
// set webgl context params
instance.WebGLPreferences.Set(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLPreference.Renderer, "WebKit WebGL");
instance.WebGLPreferences.Set(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLPreference.Vendor, "WebKit");
instance.WebGLPreferences.Set(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLPreference.Version, "WebGL 1.0 (OpenGL ES 2.0 Chromium)");
instance.WebGLPreferences.Set(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLPreference.ShadingLanguageVersion, "WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)");
instance.WebGLPreferences.Set(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLPreference.UnmaskedRenderer, "Google Inc.");
instance.WebGLPreferences.Set(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLPreference.UnmaskedVendor, "ANGLE (NVIDIA GeForce GT 630 Direct3D11 vs_5_0 ps_5_0)");
// set webgl context extensions
var extensions = new List<ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension>();
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.ANGLE_instanced_arrays);
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.EXT_blend_minmax);
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.EXT_color_buffer_float);
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.EXT_color_buffer_half_float);
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.EXT_frag_depth);
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.EXT_sRGB);
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.EXT_shader_texture_lod);
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.EXT_texture_filter_anisotropic);
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.EXT_disjoint_timer_query);
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.OES_element_index_uint);
extensions.Add(ZennoLab.InterfacesLibrary.Enums.Browser.WebGLExtension.OES_standard_derivatives);
instance.WebGLPreferences.SetExtensions(extensions);
// set webgl shader settings
instance.WebGLPreferences.SetShaderPrecisionFormat(ZennoLab.InterfacesLibrary.Enums.Browser.ShaderType.Fragment, ZennoLab.InterfacesLibrary.Enums.Browser.ShaderPrecisionType.HighInt, new ShaderPrecisionFormat(31, 31, 0));
instance.WebGLPreferences.SetShaderPrecisionFormat(ZennoLab.InterfacesLibrary.Enums.Browser.ShaderType.Vertex, ZennoLab.InterfacesLibrary.Enums.Browser.ShaderPrecisionType.MediumInt, new ShaderPrecisionFormat(31, 31, 0));
Inheritance Hierarchy

System.Object
   ZennoLab.CommandCenter.WebGLPreferences

Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

WebGLPreferences Members
ZennoLab.CommandCenter Namespace