hasForApp method

bool hasForApp(
  1. dynamic name
)

Implementation

bool hasForApp(name) {
  if (extensions.keys.isEmpty) {
    List<String> ex = gl.getExtension(name);

    extensions = {};
    for (var element in ex) {
      extensions[element] = element;
    }
  }

  Map<String, dynamic> names = {
    "EXT_color_buffer_float": "GL_EXT_color_buffer_float",
    "EXT_texture_filter_anisotropic": "GL_EXT_texture_filter_anisotropic",
    "EXT_color_buffer_half_float": "GL_EXT_color_buffer_half_float",
    "GL_OES_texture_compression_astc": "GL_OES_texture_compression_astc",
    "GL_KHR_texture_compression_astc_ldr": "GL_KHR_texture_compression_astc_ldr",
    "GL_KHR_texture_compression_astc_hdr": "GL_KHR_texture_compression_astc_hdr",
    "GL_KHR_texture_compression_astc_sliced_3d": "GL_KHR_texture_compression_astc_sliced_3d",
    "GL_EXT_texture_compression_astc_decode_mode": "GL_EXT_texture_compression_astc_decode_mode",
    "GL_EXT_texture_compression_astc_decode_mode_rgb9e5": "GL_EXT_texture_compression_astc_decode_mode_rgb9e5"
  };

  var n = names[name] ?? name;

  // print(" has for app : ${name} ");
  // developer.log( extensions.keys.toList().toString() );

  if (extensions.containsKey(n)) {
    return extensions.containsKey(n);
  } else {
    return false;
  }
}