Julia interface to GLFW, a multi-platform library for creating windows with OpenGL contexts and managing input and events.
Clone or download
Latest commit b576f1d Jul 19, 2018


GLFW.jl Travis Build Status AppVeyor Build status

Julia interface to GLFW 3, a multi-platform library for creating windows with OpenGL or OpenGL ES contexts and receiving many kinds of input. GLFW has native support for Windows, OS X and many Unix-like systems using the X Window System, such as Linux and FreeBSD.


using GLFW

# Create a window and its OpenGL context
window = GLFW.CreateWindow(640, 480, "GLFW.jl")

# Make the window's context current

# Loop until the user closes the window
while !GLFW.WindowShouldClose(window)

	# Render here

	# Swap front and back buffers

	# Poll for and process events


Trouble shooting

On linux, you will need to install these dependencies, before running Pkg.build("GLFW"):

sudo apt-get install cmake libxrandr-dev libxinerama-dev libxcursor-dev


Read the GLFW documentation for detailed instructions on how to use the library. The Julia interface is almost identical to the underlying C interface, with a few notable differences:

  • Clipboard (glfwGetClipboard, glfwSetClipboard) and time (glfwGetTime, glfwSetTime) functions have been omitted because Julia's standard library already supports similar functionality.
  • glfwInit and glfwTerminate are called automatically using the __init__ and atexit functions. While it is okay to still call them explicitly, it is redundant and not required.


  • Special thanks to @afterwise for writing an early implementation of GLFW 3 support.