glfw 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 28

GLFW FFI #

GLFW FFI bindings for Dart

0.1.0 #

  • first version

example/example.dart

import 'package:glfw/glfw.dart';
import 'package:glfw/src/glfw_init.dart';

void main() {

  // load GLFW3 dynamic library and init all its functions
  initGlfw();

  // init GLFW3
  var result = glfwInit();

  // glfwInit returns GLFW_TRUE if successful, or GLFW_FALSE if an error occurred
  print('glfwInit() result is ${result == GLFW_TRUE ? "GLFW_TRUE" : "GLFW_TRUE"}');
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  glfw: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:glfw/glfw.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
25
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
28
Learn more about scoring.

We analyzed this package on Nov 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Health issues and suggestions

Fix lib/src/glfw_header.dart. (-99.96 points)

Analysis of lib/src/glfw_header.dart failed with 27 errors, including:

line 311 col 1: Undefined name 'struct' used as an annotation.

line 312 col 7: The superclass 'Pointer

line 312 col 27: The class 'GLFWmonitor' can't extend 'Pointer'.

line 316 col 1: Undefined name 'struct' used as an annotation.

line 317 col 7: The superclass 'Pointer

Fix lib/src/glfw_init.dart. (-82.20 points)

Analysis of lib/src/glfw_init.dart failed with 6 errors, including:

line 149 col 60: The type 'GLFWmonitor Function()' given to lookupFunction must be a valid dart:ffi native function type.

line 166 col 55: The type 'GLFWwindow Function(Int32, Int32, Pointer

line 190 col 59: The type 'GLFWmonitor Function(GLFWwindow)' given to lookupFunction must be a valid dart:ffi native function type.

line 218 col 55: The type 'GLFWcursor Function(Pointer

line 219 col 63: The type 'GLFWcursor Function(Int32)' given to lookupFunction must be a valid dart:ffi native function type.

Document public APIs. (-1 points)

579 out of 579 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/glfw_library.dart. (-0.50 points)

Analysis of lib/src/glfw_library.dart reported 1 hint:

line 27 col 11: Unnecessary new keyword.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Low code quality prevents platform classification.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
Dev dependencies
pedantic ^1.0.0