getParameter method

int getParameter(
  1. int key
)

Implementation

int getParameter(int 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,
    SCISSOR_BOX,
    VIEWPORT
  ];

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