Dart bindings to GLFW 3.2.1.
Supports Linux and Windows. OSX is not supported due to inherent incompatibilites in the OSX UI threading model, as well as Apple announcing the discontinuing of support of OpenGL on OSX (https://goo.gl/qQdeQ5).
mkdir -p lib/src/generated/
pub run tools/glfw_generator.dart --glfw3_path=<path to glfw3.h>
clang-format -i --style=Google generated/*.{cc,h}
dartfmt -w generated/*.dart
mv generated/* lib/src/generatedThe previous method for compiling the bindings is no longer available. We are working on a new solution for both Linux and Windows.
In the meantime, the Makefile in the lib/ directory is a good starting point for compiling on Linux.
glfwWindowShouldClosereturns anint, rather than abool, but unlike in C, the expression!(1)returns true so you must explicitly testglfwWindowShouldClose(window) != 1- There is also a convenience function
bool glfwWindowShouldCloseAsBool(GLFWwindow window)
- There is also a convenience function
These changes are due to the C library's use of pointer arguments to return values. See also lib/src/manual_bindings.dart.
- glfwGetVersion
- Returns a
GLFWVersioninstance which hasmajor,minor,revfields.
- Returns a
- glfwGetMonitors
- Returns a
List<GLFWmonitor>instance.
- Returns a
- glfwGetMonitorPos
- Returns a
Pointinstance.
- Returns a
- glfwGetMonitorPhysicalSize
- Returns a
Rectangleinstance withxposandyposset to 0.
- Returns a
- glfwGetVideoModes
- Returns a
List<GLFWvidmode>instance.
- Returns a
- glfwGetWindowPos
- Returns a
Pointinstance.
- Returns a
- glfwGetWindowSize
- Returns a
Rectangleinstance withxposandyposset to 0.
- Returns a
- glfwGetFramebufferSize
- Returns a
Rectangleinstance withxposandyposset to 0.
- Returns a
- glfwGetWindowFrameSize
- Returns a
Rectangleinstance.
- Returns a
- glfwSetWindowUserPointer
pointerparameter is a DartObject.
- glfwGetWindowUserPointer
- Returns an
Objectinstance.
- Returns an
- glfwGetCursorPos
- Returns a
Pointinstance.
- Returns a
- glfwGetJoystickAxes
- Returns a
List<double>instance.
- Returns a
- glfwGetJoystickButtons
- Returns a
List<int>instance.
- Returns a
- glfwSwapBuffersAsync
- An async version of glfwSwapBuffers that can be
await-ed. This avoids blocking the current isolate while the glfwSwapBuffers call is waiting to finish.
- An async version of glfwSwapBuffers that can be