private void PlatformSetup() { _programCache = new ShaderProgramCache(this); MaxTextureSlots = (int)gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); GraphicsExtensions.CheckGLError(); _maxTextureSize = (int)gl.getParameter(gl.MAX_TEXTURE_SIZE); GraphicsExtensions.CheckGLError(); MaxVertexAttributes = (int)gl.getParameter(gl.MAX_VERTEX_ATTRIBS); GraphicsExtensions.CheckGLError(); _maxVertexBufferSlots = MaxVertexAttributes; _newEnabledVertexAttributes = new bool[MaxVertexAttributes]; if (gl.getSupportedExtensions().Contains("WEBGL_draw_buffers")) { _drawBuffersExtension = gl.getExtension("WEBGL_draw_buffers").As <WEBGL_draw_buffers>(); var maxDrawBuffers = _drawBuffersExtension.MAX_DRAW_BUFFERS_WEBGL.As <int>(); _drawBuffers = new double[maxDrawBuffers]; for (int i = 0; i < maxDrawBuffers; i++) { _drawBuffers[i] = _drawBuffersExtension.COLOR_ATTACHMENT0_WEBGL + i; } } }
private void PlatformSetup() { _programCache = new ShaderProgramCache(this); MaxTextureSlots = (int)gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); GraphicsExtensions.CheckGLError(); _maxTextureSize = (int)gl.getParameter(gl.MAX_TEXTURE_SIZE); GraphicsExtensions.CheckGLError(); MaxVertexAttributes = (int)gl.getParameter(gl.MAX_VERTEX_ATTRIBS); GraphicsExtensions.CheckGLError(); _maxVertexBufferSlots = MaxVertexAttributes; _newEnabledVertexAttributes = new bool[MaxVertexAttributes]; }