getParameter method
Implementation
int getParameter(int key) {
startCheck("getParameter");
List<int> _intValues = [
WebGL.MAX_TEXTURE_IMAGE_UNITS,
WebGL.MAX_VERTEX_TEXTURE_IMAGE_UNITS,
WebGL.MAX_TEXTURE_SIZE,
WebGL.MAX_CUBE_MAP_TEXTURE_SIZE,
WebGL.MAX_VERTEX_ATTRIBS,
WebGL.MAX_VERTEX_UNIFORM_VECTORS,
WebGL.MAX_VARYING_VECTORS,
WebGL.MAX_FRAGMENT_UNIFORM_VECTORS,
WebGL.MAX_SAMPLES,
WebGL.MAX_COMBINED_TEXTURE_IMAGE_UNITS,
WebGL.SCISSOR_BOX,
WebGL.VIEWPORT
];
if (_intValues.contains(key)) {
Object? val = glGetParameter(_gl, key)?.dartify();
if(val is List<int>){
return ByteData.view(Uint8List.fromList(val).buffer).getUint32(0);
}
else if(val is double){
return val.toInt();
}
else if(val is bool){
return val?1:0;
}
return val as int;
}
else {
return key;
//throw (" OpenGL getParameter key: ${key} is not support ");
}
}