glfw 0.2.0

GLFW FFI #

GLFW 3.3 FFI bindings for Dart. Supports Windows and Linux desktops.

0.2.0 #

  • use ffi_utils

0.1.0 #

  • first version

example/example.dart

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

void main() {
  initGlfw();

  glfwInit();
  print('GLFW: ${NativeString.fromPointer(glfwGetVersionString())}');
    
  var window = glfwCreateWindow(
    640, 480,
    NativeString.fromString('Dart FFI + GLFW + OpenGL'), 
    nullptr.cast(), nullptr.cast());

  while (glfwWindowShouldClose(window) != GLFW_TRUE)
  {
      glfwSwapBuffers(window);
      glfwPollEvents();
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  glfw: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter 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]
48
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
74
Learn more about scoring.

We analyzed this package on Feb 10, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health issues and suggestions

Document public APIs. (-1 points)

615 out of 615 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.

Format lib/src/glfw_header.dart.

Run dartfmt to format lib/src/glfw_header.dart.

Format lib/src/glfw_init.dart.

Run dartfmt to format lib/src/glfw_init.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
ffi_utils ^0.1.0 0.1.0
Transitive dependencies
ffi 0.1.3
Dev dependencies
pedantic ^1.0.0