getParameter method

dynamic getParameter(
  1. dynamic key
)

Implementation

getParameter(key) {
  // print("OpenGL getParameter key: ${key} ");

  List<int> _intValues = [
    MAX_TEXTURE_IMAGE_UNITS,
    MAX_VERTEX_TEXTURE_IMAGE_UNITS,
    MAX_TEXTURE_SIZE,
    MAX_CUBE_MAP_TEXTURE_SIZE,
    MAX_VERTEX_ATTRIBS,
    MAX_VERTEX_UNIFORM_VECTORS,
    MAX_VARYING_VECTORS,
    MAX_FRAGMENT_UNIFORM_VECTORS,
    MAX_SAMPLES,
    MAX_COMBINED_TEXTURE_IMAGE_UNITS,
    GL_SCISSOR_BOX,
    GL_VIEWPORT,
    MAX_TEXTURE_MAX_ANISOTROPY_EXT
  ];

  if (_intValues.indexOf(key) >= 0) {
    final v = calloc<Int32>(4);
    gl.glGetIntegerv(key, v);
    return v.value;
  } else {
    throw (" OpenGL getParameter key: ${key} is not support ");
  }
}