WebGLTextures constructor

WebGLTextures(
  1. dynamic gl,
  2. WebGLExtensions extensions,
  3. WebGLState state,
  4. WebGLProperties properties,
  5. WebGLCapabilities capabilities,
  6. WebGLUtils utils,
  7. WebGLInfo info,
)

Implementation

WebGLTextures(this.gl, this.extensions, this.state, this.properties, this.capabilities, this.utils, this.info) {
  maxTextures = capabilities.maxTextures;
  maxCubemapSize = capabilities.maxCubemapSize;
  maxTextureSize = capabilities.maxTextureSize;
  maxSamples = capabilities.maxSamples;
  multisampledRenderToTextureExtension = extensions.has('WEBGL_multisampled_render_to_texture') != null
      ? extensions.get('WEBGL_multisampled_render_to_texture')
      : null;

  wrappingToGL[RepeatWrapping] = gl.REPEAT;
  wrappingToGL[ClampToEdgeWrapping] = gl.CLAMP_TO_EDGE;
  wrappingToGL[MirroredRepeatWrapping] = gl.MIRRORED_REPEAT;

  filterToGL[NearestFilter] = gl.NEAREST;
  filterToGL[NearestMipmapNearestFilter] = gl.NEAREST_MIPMAP_NEAREST;
  filterToGL[NearestMipmapLinearFilter] = gl.NEAREST_MIPMAP_LINEAR;
  filterToGL[LinearFilter] = gl.LINEAR;
  filterToGL[LinearMipmapNearestFilter] = gl.LINEAR_MIPMAP_NEAREST;
  filterToGL[LinearMipmapLinearFilter] = gl.LINEAR_MIPMAP_LINEAR;

  // TODO FIXME when on web && is OculusBrowser
  // supportsInvalidateFramenbuffer = kIsWeb && RegExp(r"OculusBrowser").hasMatch( navigator.userAgent );
}