GLFW.jl

授权协议 MIT License
开发语言 C/C++
所属分类 程序开发、 图形/图像处理
软件类型 开源软件
地区 不详
投 递 者 松建本
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

GLFW.jl

CI

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.

Example

using GLFW

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

# Make the window's context current
GLFW.MakeContextCurrent(window)

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

	# Render here

	# Swap front and back buffers
	GLFW.SwapBuffers(window)

	# Poll for and process events
	GLFW.PollEvents()
end

GLFW.DestroyWindow(window)

Interface

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.

Footnotes

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

相关阅读

相关文章

相关问答

相关文档