opengl 0.1.0+2

OpenGL FFI #

OpenGL 4.6 FFI bindings for Dart. Supports Windows and Linux desktops.

0.1.0+2 #

  • add GLFW example

0.1.0+1 #

  • add change log
  • add example

0.1.0 #

  • first version


import 'package:opengl/opengl.dart';
import 'package:opengl/src/opengl_init.dart';

void main() {
  // create OpenGL context and make it current

  // load OpenGL dynamic library and init all its functions

  // use OpenGL
  var result = glGetError();

  // glGetError returns GL_NO_ERROR if successful, 
  // or GL_INVALID_OPERATION = 0x0502 (1282) without context in our case
  print('glGetError() result is ${result == GL_NO_ERROR ? "GL_NO_ERROR" : result}');

Use this package as a library

1. Depend on it

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

  opengl: ^0.1.0+2

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:opengl/opengl.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:opengl/opengl.dart.

Health issues and suggestions

Document public APIs. (-1 points)

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

Format lib/src/c_utils.dart.

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

Format lib/src/opengl_header.dart.

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

Format lib/src/opengl_init.dart.

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

Format lib/src/opengl_library.dart.

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


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