glGetProgramResourceLocationIndex function

int glGetProgramResourceLocationIndex(
  1. int program,
  2. int programInterface,
  3. String name
)
define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex)
GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex
typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name)

Implementation

int glGetProgramResourceLocationIndex(
    int program, int programInterface, String name) {
  final glGetProgramResourceLocationIndexAsFunction =
      _glGetProgramResourceLocationIndex
          .cast<
              NativeFunction<
                  Int32 Function(Uint32 program, Uint32 programInterface,
                      Pointer<Utf8> name)>>()
          .asFunction<
              int Function(
                  int program, int programInterface, Pointer<Utf8> name)>();
  final namePointer = name.toNativeUtf8();
  final result = glGetProgramResourceLocationIndexAsFunction(
      program, programInterface, namePointer);
  calloc.free(namePointer);
  return result;
}