eglGetConfigAttrib function

int eglGetConfigAttrib(
  1. Pointer<Void> display,
  2. Pointer<Void> config,
  3. EglConfigAttribute attribute
)

Implementation

int eglGetConfigAttrib(
    Pointer<Void> display, Pointer<Void> config, EglConfigAttribute attribute) {
  final value = calloc<Int32>();
  final nativeCallSucceeded = _libEGL!.eglGetConfigAttrib(
        display,
        config,
        attribute.toIntValue(),
        value.cast(),
      ) ==
      1;
  int result = -1;
  if (nativeCallSucceeded) {
    result = value.value;
  }

  calloc.free(value);

  if (!nativeCallSucceeded) {
    throw EglException(
        'Failed to get configs attribute for display [$display], attribute:  ${attribute.toString()}.');
  }

  return result;
}