Per-windowcallbacks
glfwSetWindowPosCallback($window, $cbfun)
$windowpos_cbfun = sub ($window, $xpos, $ypos) { ... }
glfwSetWindowSizeCallback($window, $cbfun)
$windowsize_cbfun = sub ($window, $width, $height) { ... }
glfwSetWindowCloseCallback($window, $cbfun)
$windowclose_cbfun = sub ($window) { ... }
glfwSetWindowRefreshCallback($window, $cbfun)
$windowrefresh_cbfun = sub ($window) { ... }
glfwSetWindowFocusCallback($window, $cbfun)
$windowfocus_cbfun = sub ($window, $focused) { ... }
glfwSetWindowIconifyCallback($window, $cbfun)
$windowiconify_cbfun = sub ($window, $iconified) { ... }
glfwSetFramebufferSizeCallback($window, $cbfun)
$framebuffersize_cbfun = sub ($window, $width, $height) { ... }
glfwSetKeyCallback($window, $cbfun)
$key_cbfun = sub ($window, $key, $scancode, $action, $mods) { ... }
glfwSetCharCallback($window, $cbfun)
$char_cbfun = sub ($window, $codepoint) { ... }
glfwSetCharModsCallback($window, $cbfun)
$charmods_cbfun = sub ($window, $codepoint, $mods) { ... }
glfwSetMouseButtonCallback($window, $cbfun)
$mousebutton_cbfun = sub ($window, $button, $action, $mods) { ... }
glfwSetCursorPosCallback($window, $cbfun)
$cursorpos_cbfun = sub ($window, $xpos, $ypos) { ... }
glfwSetCursorEnterCallback($window, $cbfun)
$cursorenter_cbfun = sub ($window, $entered) { ... }
glfwSetScrollCallback($window, $cbfun)
$scroll_cbfun = sub ($window, $xoffset, $yoffset) { ... }
glfwSetDropCallback($window, $cbfun)
$drop_cbfun = sub ($window, $count, @paths) { ... }
Globalcallbacks
glfwSetErrorCallback($cbfun)
$error_cbfun = sub ($error, $description) { ... }
glfwSetMonitorCallback($cbfun)
$monitor_cbfun = sub ($monitor, $event) { ... }
glfwSetJoystickCallback($cbfun)
$joystick_cbfun = sub ($joy_id, $event) { ... }
Icons/Cursors/Images
glfwSetWindowIcon($window, $image_hash, ...)
$cursor = glfwCreateCursor($image_hash, $xhot, $yhot)
$cursor = glfwCreateStandardCursor($shape)
glfwDestroyCursor($cursor)
glfwSetCursor($window, $cursor)
where
$image_hash = {
# The width, in pixels, of this image.
width => $width,
# The height, in pixels, of this image.
height => $height,
# The pixel data of this image, arranged
# left-to-right, top-to-bottom in a packed
# string of unsigned char data.
pixels => $pixels
}
Monitors
$monitor = glfwGetPrimaryMonitor()
@monitors = glfwGetMonitors()
$name = glfwGetMonitorName($monitor)
($widthMM, $heightMM) = glfwGetMonitorPhysicalSize($monitor)
($xpos, $ypos) = glfwGetMonitorPos($monitor)
($xpos, $ypos, $width, $height) = glfwGetMonitorWorkarea($monitor)
GammaSettings
glfwSetGamma($monitor, $gamma)
$gammaramp_hash = glfwGetGammaRamp($monitor)
glfwSetGammaRamp($monitor, $gammaramp_hash)
where
$gammaramp_hash = {
# An array of values describing the
# response of the red channel as a
# string of packed unsigned short data.
red => $red,
# An array of values describing the
# response of the green channel as a
# string of packed unsigned short data.
green => $green,
# An array of values describing the
# response of the blue channel as a
# string of packed unsigned short data.
blue => $blue,
# The number of elements in each array.
size => $size
}
VideoMode
$vidmode_hash = glfwGetVideoMode($monitor)
@vidmodes = glfwGetVideoModes($monitor); # elements are vid mode hashes
where
$vidmode_hash = {
# The width, in screen coordinates, of the video mode.
width => $width,
# The height, in screen coordinates, of the video mode.
height => $height,
# The bit depth of the red channel of the video mode.
redBits => $redBits,
# The bit depth of the green channel of the video mode.
greenBits => $greenBits,
# The bit depth of the blue channel of the video mode.
blueBits => $blueBitsm,
# The refresh rate, in Hz, of the video mode.
refreshRate => $refreshRate
}
WindowsandInteraction
$monitor = glfwGetWindowMonitor($window); # monitor of full screen window or undef?
$window = glfwCreateWindow($width, $height, $title, $monitor or NULL, $share_window or NULL)
glfwSetWindowMonitor($window, $monitor, $xpos, $ypos, $width, $height, $refreshRate)
$window = glfwGetCurrentContext()
$value = glfwGetInputMode($window, $mode)
$pressed = glfwGetKey($window, $key)
$pressed = glfwGetMouseButton($window, $button)
$value = glfwGetWindowAttrib($window, $attrib)
$value = glfwWindowShouldClose($window)
glfwDestroyWindow($window)
glfwFocusWindow($window)
$string = glfwGetClipboardString($window)
($xpos, $ypos) = glfwGetCursorPos($window)
($width, $height) = glfwGetFramebufferSize($window)
($left, $top, $right, $bottom) = glfwGetWindowFrameSize($window)
($xpos, $ypos) = glfwGetWindowPos($window)
($width, $height) = glfwGetWindowSize($window)
glfwHideWindow($window)
glfwIconifyWindow($window)
glfwMakeContextCurrent($window)
glfwMaximizeWindow($window)
glfwRestoreWindow($window)
glfwSetClipboardString($window, $string)
glfwSetCursorPos($window, $xpos, $ypos)
glfwSetInputMode($window, $mode, $value)
glfwSetWindowAspectRatio($window, $numer, $denom)
glfwSetWindowPos($window, $xpos, $ypos)
glfwSetWindowShouldClose($window, $value)
glfwSetWindowSize($window, $width, $height)
glfwSetWindowSizeLimits($window, $minwidth, $minheight, $maxwidth, $maxheight)
glfwSetWindowTitle($window, $title)
glfwSetWindowUserPointer($window, $ref)
glfwShowWindow($window)
glfwSwapBuffers($window)
$ref = glfwGetWindowUserPointer($window)
glfwDefaultWindowHints()
($major, $minor, $rev) = glfwGetVersion()
glfwPollEvents()
glfwPostEmptyEvent()
glfwSetTime($time)
glfwSwapInterval($interval)
glfwTerminate()
glfwWaitEvents()
glfwWaitEventsTimeout($timeout)
glfwWindowHint($hint, $value)
$name = glfwGetJoystickName($joy)
$name = glfwGetKeyName($key, $scancode)
$version = glfwGetVersionString()
@axes = glfwGetJoystickAxes($joy)
@buttons = glfwGetJoystickButtons($joy)
$status = glfwInit()
$ispresent = glfwJoystickPresent($joy)
$time = glfwGetTime()
$frequency = glfwGetTimerFrequency()
$timervalue = glfwGetTimerValue()
$supported = glfwVulkanSupported()
GLFWOpenGLExtensionchecksarenotimplemented
glfwExtensionSupported
glfwGetProcAddress
Vulkannotimplemented
glfwGetRequiredInstanceExtensions
glfwGetInstanceProcAddress
glfwGetPhysicalDevicePresentationSupport
glfwCreateWindowSurface