glfw

package
v0.0.0-...-fcfa13c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionMajor    = C.GLFW_VERSION_MAJOR    // This is incremented when the API is changed in non-compatible ways.
	VersionMinor    = C.GLFW_VERSION_MINOR    // This is incremented when features are added to the API but it remains backward-compatible.
	VersionRevision = C.GLFW_VERSION_REVISION // This is incremented when a bug fix release is made that does not contain any API changes.
)

Version constants.

View Source
const (
	CursorNormal   int = C.GLFW_CURSOR_NORMAL
	CursorHidden   int = C.GLFW_CURSOR_HIDDEN
	CursorDisabled int = C.GLFW_CURSOR_DISABLED
)

Cursor mode values.

View Source
const (
	OpenGLAPI   int = C.GLFW_OPENGL_API
	OpenGLESAPI int = C.GLFW_OPENGL_ES_API
	NoAPI       int = C.GLFW_NO_API
)

Values for the ClientAPI hint.

View Source
const (
	NativeContextAPI int = C.GLFW_NATIVE_CONTEXT_API
	EGLContextAPI    int = C.GLFW_EGL_CONTEXT_API
)

Values for ContextCreationAPI hint.

View Source
const (
	NoRobustness        int = C.GLFW_NO_ROBUSTNESS
	NoResetNotification int = C.GLFW_NO_RESET_NOTIFICATION
	LoseContextOnReset  int = C.GLFW_LOSE_CONTEXT_ON_RESET
)

Values for the ContextRobustness hint.

View Source
const (
	AnyReleaseBehavior   int = C.GLFW_ANY_RELEASE_BEHAVIOR
	ReleaseBehaviorFlush int = C.GLFW_RELEASE_BEHAVIOR_FLUSH
	ReleaseBehaviorNone  int = C.GLFW_RELEASE_BEHAVIOR_NONE
)

Values for ContextReleaseBehavior hint.

View Source
const (
	OpenGLAnyProfile    int = C.GLFW_OPENGL_ANY_PROFILE
	OpenGLCoreProfile   int = C.GLFW_OPENGL_CORE_PROFILE
	OpenGLCompatProfile int = C.GLFW_OPENGL_COMPAT_PROFILE
)

Values for the OpenGLProfile hint.

View Source
const (
	True     int = 1 // GL_TRUE
	False    int = 0 // GL_FALSE
	DontCare int = C.GLFW_DONT_CARE
)

Other values.

Variables

This section is empty.

Functions

func DefaultWindowHints

func DefaultWindowHints()

DefaultWindowHints resets all window hints to their default values.

This function may only be called from the main thread.

func DetachCurrentContext

func DetachCurrentContext()

DetachCurrentContext detaches the current context.

func ExtensionSupported

func ExtensionSupported(extension string) bool

ExtensionSupported reports whether the specified OpenGL or context creation API extension is supported by the current context. For example, on Windows both the OpenGL and WGL extension strings are checked.

As this functions searches one or more extension strings on each call, it is recommended that you cache its results if it's going to be used frequently. The extension strings will not change during the lifetime of a context, so there is no danger in doing this.

func GetJoystickAxes

func GetJoystickAxes(joy Joystick) []float32

GetJoystickAxes returns a slice of axis values.

func GetJoystickButtons

func GetJoystickButtons(joy Joystick) []byte

GetJoystickButtons returns a slice of button values.

func GetJoystickName

func GetJoystickName(joy Joystick) string

GetJoystickName returns the name, encoded as UTF-8, of the specified joystick.

func GetKeyName

func GetKeyName(key Key, scancode int) string

GetKeyName returns the localized name of the specified printable key.

If the key is glfw.KeyUnknown, the scancode is used, otherwise the scancode is ignored.

func GetProcAddress

func GetProcAddress(procname string) unsafe.Pointer

GetProcAddress returns the address of the specified OpenGL or OpenGL ES core or extension function, if it is supported by the current context.

A context must be current on the calling thread. Calling this function without a current context will cause a GLFW_NO_CURRENT_CONTEXT error.

This function is used to provide GL proc resolving capabilities to an external C library.

func GetTime

func GetTime() float64

GetTime returns the value of the GLFW timer. Unless the timer has been set using SetTime, the timer measures time elapsed since GLFW was initialized.

The resolution of the timer is system dependent, but is usually on the order of a few micro- or nanoseconds. It uses the highest-resolution monotonic time source on each supported platform.

func GetTimerFrequency

func GetTimerFrequency() uint64

GetTimerFrequency returns frequency of the timer, in Hz, or zero if an error occurred.

func GetTimerValue

func GetTimerValue() uint64

GetTimerValue returns the current value of the raw timer, measured in 1 / frequency seconds.

func GetVersion

func GetVersion() (major, minor, revision int)

GetVersion retrieves the major, minor and revision numbers of the GLFW library. It is intended for when you are using GLFW as a shared library and want to ensure that you are using the minimum required version.

This function may be called before Init.

func GetVersionString

func GetVersionString() string

GetVersionString returns a static string generated at compile-time according to which configuration macros were defined. This is intended for use when submitting bug reports, to allow developers to see which code paths are enabled in a binary.

This function may be called before Init.

func GetX11Display

func GetX11Display() *C.Display

func Init

func Init() error

Init initializes the GLFW library. Before most GLFW functions can be used, GLFW must be initialized, and before a program terminates GLFW should be terminated in order to free any resources allocated during or after initialization.

If this function fails, it calls Terminate before returning. If it succeeds, you should call Terminate before the program exits.

Additional calls to this function after successful initialization but before termination will succeed but will do nothing.

This function may take several seconds to complete on some systems, while on other systems it may take only a fraction of a second to complete.

On Mac OS X, this function will change the current directory of the application to the Contents/Resources subdirectory of the application's bundle, if present.

This function may only be called from the main thread.

func JoystickPresent

func JoystickPresent(joy Joystick) bool

JoystickPresent reports whether the specified joystick is present.

func PollEvents

func PollEvents()

PollEvents processes only those events that have already been received and then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.

This function is not required for joystick input to work.

This function may not be called from a callback.

This function may only be called from the main thread.

func PostEmptyEvent

func PostEmptyEvent()

PostEmptyEvent posts an empty event from the current thread to the main thread event queue, causing WaitEvents to return.

If no windows exist, this function returns immediately. For synchronization of threads in applications that do not create windows, use native Go primitives.

This function may be called from secondary threads.

func SetMonitorCallback

func SetMonitorCallback(cbfun func(monitor *Monitor, event MonitorEvent))

SetMonitorCallback sets the monitor configuration callback, or removes the currently set callback. This is called when a monitor is connected to or disconnected from the system.

func SetTime

func SetTime(time float64)

SetTime sets the value of the GLFW timer. It then continues to count up from that value.

The resolution of the timer is system dependent, but is usually on the order of a few micro- or nanoseconds. It uses the highest-resolution monotonic time source on each supported platform.

func SwapInterval

func SwapInterval(interval int)

SwapInterval sets the swap interval for the current context, i.e. the number of screen updates to wait before swapping the buffers of a window and returning from SwapBuffers. This is sometimes called 'vertical synchronization', 'vertical retrace synchronization' or 'vsync'.

Contexts that support either of the WGL_EXT_swap_control_tear and GLX_EXT_swap_control_tear extensions also accept negative swap intervals, which allow the driver to swap even if a frame arrives a little bit late. You can check for the presence of these extensions using ExtensionSupported. For more information about swap tearing, see the extension specifications.

Some GPU drivers do not honor the requested swap interval, either because of user settings that override the request or due to bugs in the driver.

func Terminate

func Terminate()

Terminate destroys all remaining windows, frees any allocated resources and sets the library to an uninitialized state. Once this is called, you must again call Init successfully before you will be able to use most GLFW functions.

If GLFW has been successfully initialized, this function should be called before the program exits. If initialization fails, there is no need to call this function, as it is called by Init before it returns failure.

This function may only be called from the main thread.

func VulkanSupported

func VulkanSupported() bool

VulkanSupported reports whether the Vulkan loader has been found. This check is performed by Init.

The availability of a Vulkan loader does not by itself guarantee that window surface creation or even device creation is possible. Call GetRequiredInstanceExtensions to check whether the extensions necessary for Vulkan surface creation are available and GetPhysicalDevicePresentationSupport to check whether a queue family of a physical device supports image presentation.

func WaitEvents

func WaitEvents()

WaitEvents puts the calling thread to sleep until at least one event has been received. Once one or more events have been recevied, it behaves as if PollEvents was called, i.e. the events are processed and the function then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.

Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all callbacks.

This function may not be called from a callback.

This function may only be called from the main thread.

func WaitEventsTimeout

func WaitEventsTimeout(timeout float64)

WaitEventsTimeout puts the calling thread to sleep until at least one event is available in the event queue, or until the specified timeout is reached. If one or more events are available, it behaves exactly like PollEvents, i.e. the events in the queue are processed and the function then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.

The timeout value must be a positive finite number.

Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all callbacks.

On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the window refresh callback to redraw the contents of your window when necessary during such operations.

On some platforms, certain callbacks may be called outside of a call to one of the event processing functions.

If no windows exist, this function returns immediately. For synchronization of threads in applications that do not create windows, use native Go primitives.

Event processing is not required for joystick input to work.

func WindowHint

func WindowHint(target Hint, hint int)

WindowHint sets hints for the next call to CreateWindow. The hints, once set, retain their values until changed by a call to WindowHint or DefaultWindowHints, or until the library is terminated with Terminate.

This function may only be called from the main thread.

Types

type Action

type Action int

Action corresponds to a key or button action.

const (
	Release Action = C.GLFW_RELEASE // The key or button was released.
	Press   Action = C.GLFW_PRESS   // The key or button was pressed.
	Repeat  Action = C.GLFW_REPEAT  // The key was held down until it repeated.
)

Action types.

type CharCallback

type CharCallback func(w *Window, char rune)

CharCallback is the character callback.

type CharModsCallback

type CharModsCallback func(w *Window, char rune, mods ModifierKey)

CharModsCallback is the character with modifiers callback.

type CloseCallback

type CloseCallback func(w *Window)

CloseCallback is the window close callback.

type Cursor

type Cursor struct {
	// contains filtered or unexported fields
}

Cursor represents a cursor.

func CreateCursor

func CreateCursor(img image.Image, xhot, yhot int) *Cursor

CreateCursor creates a new custom cursor image that can be set for a window with SetCursor. The cursor can be destroyed with Destroy. Any remaining cursors are destroyed by Terminate.

The image is ideally provided in the form of *image.NRGBA. The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel with the red channel first. They are arranged canonically as packed sequential rows, starting from the top-left corner. If the image type is not *image.NRGBA, it will be converted to it.

The cursor hotspot is specified in pixels, relative to the upper-left corner of the cursor image. Like all other coordinate systems in GLFW, the X-axis points to the right and the Y-axis points down.

func CreateStandardCursor

func CreateStandardCursor(shape StandardCursor) *Cursor

CreateStandardCursor returns a cursor with a standard shape, that can be set for a window with SetCursor.

func (*Cursor) Destroy

func (c *Cursor) Destroy()

Destroy destroys a cursor previously created with CreateCursor. Any remaining cursors will be destroyed by Terminate.

type CursorEnterCallback

type CursorEnterCallback func(w *Window, entered bool)

CursorEnterCallback is the cursor boundary crossing callback.

type CursorPosCallback

type CursorPosCallback func(w *Window, xpos float64, ypos float64)

CursorPosCallback the cursor position callback.

type DropCallback

type DropCallback func(w *Window, names []string)

DropCallback is the drop callback.

type Error

type Error struct {
	Code ErrorCode
	Desc string
}

Error holds error code and description.

func (*Error) Error

func (e *Error) Error() string

Error prints the error code and description in a readable format.

type ErrorCode

type ErrorCode int

ErrorCode corresponds to an error code.

const (
	// APIUnavailable is the error code used when GLFW could not find support
	// for the requested client API on the system.
	//
	// The installed graphics driver does not support the requested client API,
	// or does not support it via the chosen context creation backend. Below
	// are a few examples.
	//
	// Some pre-installed Windows graphics drivers do not support OpenGL. AMD
	// only supports OpenGL ES via EGL, while Nvidia and Intel only supports it
	// via a WGL or GLX extension. OS X does not provide OpenGL ES at all. The
	// Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the
	// Nvidia binary driver.
	APIUnavailable ErrorCode = C.GLFW_API_UNAVAILABLE

	// VersionUnavailable is the error code used when the requested OpenGL or
	// OpenGL ES (including any requested profile or context option) is not
	// available on this machine.
	//
	// The machine does not support your requirements. If your application is
	// sufficiently flexible, downgrade your requirements and try again.
	// Otherwise, inform the user that their machine does not match your
	// requirements.
	//
	// Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if
	// 5.0 comes out before the 4.x series gets that far, also fail with this
	// error and not GLFW_INVALID_VALUE, because GLFW cannot know what future
	// versions will exist.
	VersionUnavailable ErrorCode = C.GLFW_VERSION_UNAVAILABLE

	// FormatUnavailable is the error code used for both window creation and
	// clipboard querying format errors.
	//
	// If emitted during window creation, the requested pixel format is not
	// supported. This means one or more hard constraints did not match any of
	// the available pixel formats. If your application is sufficiently
	// flexible, downgrade your requirements and try again. Otherwise, inform
	// the user that their machine does not match your requirements.
	//
	// If emitted when querying the clipboard, the contents of the clipboard
	// could not be converted to the requested format. You should ignore the
	// error or report it to the user, as appropriate.
	FormatUnavailable ErrorCode = C.GLFW_FORMAT_UNAVAILABLE
)

func (ErrorCode) String

func (e ErrorCode) String() string

type FocusCallback

type FocusCallback func(w *Window, focused bool)

FocusCallback is the window focus callback.

type FramebufferSizeCallback

type FramebufferSizeCallback func(w *Window, width int, height int)

FramebufferSizeCallback is the framebuffer size callback.

type GammaRamp

type GammaRamp struct {
	Red   []uint16 // A slice of value describing the response of the red channel.
	Green []uint16 // A slice of value describing the response of the green channel.
	Blue  []uint16 // A slice of value describing the response of the blue channel.
}

GammaRamp describes the gamma ramp for a monitor.

type Hint

type Hint int

Hint corresponds to hints that can be set before creating a window.

Hint also corresponds to the attributes of the window that can be get after its creation.

const (
	Focused     Hint = C.GLFW_FOCUSED      // Specifies whether the window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.
	Iconified   Hint = C.GLFW_ICONIFIED    // Specifies whether the window will be minimized.
	Maximized   Hint = C.GLFW_MAXIMIZED    // Specifies whether the window is maximized.
	Visible     Hint = C.GLFW_VISIBLE      // Specifies whether the window will be initially visible.
	Resizable   Hint = C.GLFW_RESIZABLE    // Specifies whether the window will be resizable by the user.
	Decorated   Hint = C.GLFW_DECORATED    // Specifies whether the window will have window decorations such as a border, a close widget, etc.
	Floating    Hint = C.GLFW_FLOATING     // Specifies whether the window will be always-on-top.
	AutoIconify Hint = C.GLFW_AUTO_ICONIFY // Specifies whether fullscreen windows automatically iconify (and restore the previous video mode) on focus loss.
)

Window related hints.

const (
	ClientAPI               Hint = C.GLFW_CLIENT_API               // Specifies which client API to create the context for. Hard constraint.
	ContextVersionMajor     Hint = C.GLFW_CONTEXT_VERSION_MAJOR    // Specifies the client API version that the created context must be compatible with.
	ContextVersionMinor     Hint = C.GLFW_CONTEXT_VERSION_MINOR    // Specifies the client API version that the created context must be compatible with.
	ContextRobustness       Hint = C.GLFW_CONTEXT_ROBUSTNESS       // Specifies the robustness strategy to be used by the context.
	ContextReleaseBehavior  Hint = C.GLFW_CONTEXT_RELEASE_BEHAVIOR // Specifies the release behavior to be used by the context.
	OpenGLForwardCompatible Hint = C.GLFW_OPENGL_FORWARD_COMPAT    // Specifies whether the OpenGL context should be forward-compatible. Hard constraint.
	OpenGLDebugContext      Hint = C.GLFW_OPENGL_DEBUG_CONTEXT     // Specifies whether to create a debug OpenGL context, which may have additional error and performance issue reporting functionality. If OpenGL ES is requested, this hint is ignored.
	OpenGLProfile           Hint = C.GLFW_OPENGL_PROFILE           // Specifies which OpenGL profile to create the context for. Hard constraint.
	ContextCreationAPI      Hint = C.GLFW_CONTEXT_CREATION_API     // Specifies which context creation API to use to create the context.
)

Context related hints.

const (
	ContextRevision Hint = C.GLFW_CONTEXT_REVISION
	RedBits         Hint = C.GLFW_RED_BITS         // Specifies the desired bit depth of the default framebuffer.
	GreenBits       Hint = C.GLFW_GREEN_BITS       // Specifies the desired bit depth of the default framebuffer.
	BlueBits        Hint = C.GLFW_BLUE_BITS        // Specifies the desired bit depth of the default framebuffer.
	AlphaBits       Hint = C.GLFW_ALPHA_BITS       // Specifies the desired bit depth of the default framebuffer.
	DepthBits       Hint = C.GLFW_DEPTH_BITS       // Specifies the desired bit depth of the default framebuffer.
	StencilBits     Hint = C.GLFW_STENCIL_BITS     // Specifies the desired bit depth of the default framebuffer.
	AccumRedBits    Hint = C.GLFW_ACCUM_RED_BITS   // Specifies the desired bit depth of the accumulation buffer.
	AccumGreenBits  Hint = C.GLFW_ACCUM_GREEN_BITS // Specifies the desired bit depth of the accumulation buffer.
	AccumBlueBits   Hint = C.GLFW_ACCUM_BLUE_BITS  // Specifies the desired bit depth of the accumulation buffer.
	AccumAlphaBits  Hint = C.GLFW_ACCUM_ALPHA_BITS // Specifies the desired bit depth of the accumulation buffer.
	AuxBuffers      Hint = C.GLFW_AUX_BUFFERS      // Specifies the desired number of auxiliary buffers.
	Stereo          Hint = C.GLFW_STEREO           // Specifies whether to use stereoscopic rendering. Hard constraint.
	Samples         Hint = C.GLFW_SAMPLES          // Specifies the desired number of samples to use for multisampling. Zero disables multisampling.
	SRGBCapable     Hint = C.GLFW_SRGB_CAPABLE     // Specifies whether the framebuffer should be sRGB capable.
	RefreshRate     Hint = C.GLFW_REFRESH_RATE     // Specifies the desired refresh rate for full screen windows. If set to zero, the highest available refresh rate will be used. This hint is ignored for windowed mode windows.
	DoubleBuffer    Hint = C.GLFW_DOUBLEBUFFER     // Specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint.
)

Framebuffer related hints.

type IconifyCallback

type IconifyCallback func(w *Window, iconified bool)

IconifyCallback is the window iconification callback.

type InputMode

type InputMode int

InputMode corresponds to an input mode.

const (
	CursorMode             InputMode = C.GLFW_CURSOR               // See Cursor mode values
	StickyKeysMode         InputMode = C.GLFW_STICKY_KEYS          // Value can be either 1 or 0
	StickyMouseButtonsMode InputMode = C.GLFW_STICKY_MOUSE_BUTTONS // Value can be either 1 or 0
)

Input modes.

type Joystick

type Joystick int

Joystick corresponds to a joystick.

Joystick IDs.

type JoystickCallback

type JoystickCallback func(joy, event int)

JoystickCallback is the joystick configuration callback.

func SetJoystickCallback

func SetJoystickCallback(cbfun JoystickCallback) (previous JoystickCallback)

SetJoystickCallback sets the joystick configuration callback, or removes the currently set callback. This is called when a joystick is connected to or disconnected from the system.

type Key

type Key int

Key corresponds to a keyboard key.

const (
	KeyUnknown      Key = C.GLFW_KEY_UNKNOWN
	KeySpace        Key = C.GLFW_KEY_SPACE
	KeyApostrophe   Key = C.GLFW_KEY_APOSTROPHE
	KeyComma        Key = C.GLFW_KEY_COMMA
	KeyMinus        Key = C.GLFW_KEY_MINUS
	KeyPeriod       Key = C.GLFW_KEY_PERIOD
	KeySlash        Key = C.GLFW_KEY_SLASH
	Key0            Key = C.GLFW_KEY_0
	Key1            Key = C.GLFW_KEY_1
	Key2            Key = C.GLFW_KEY_2
	Key3            Key = C.GLFW_KEY_3
	Key4            Key = C.GLFW_KEY_4
	Key5            Key = C.GLFW_KEY_5
	Key6            Key = C.GLFW_KEY_6
	Key7            Key = C.GLFW_KEY_7
	Key8            Key = C.GLFW_KEY_8
	Key9            Key = C.GLFW_KEY_9
	KeySemicolon    Key = C.GLFW_KEY_SEMICOLON
	KeyEqual        Key = C.GLFW_KEY_EQUAL
	KeyA            Key = C.GLFW_KEY_A
	KeyB            Key = C.GLFW_KEY_B
	KeyC            Key = C.GLFW_KEY_C
	KeyD            Key = C.GLFW_KEY_D
	KeyE            Key = C.GLFW_KEY_E
	KeyF            Key = C.GLFW_KEY_F
	KeyG            Key = C.GLFW_KEY_G
	KeyH            Key = C.GLFW_KEY_H
	KeyI            Key = C.GLFW_KEY_I
	KeyJ            Key = C.GLFW_KEY_J
	KeyK            Key = C.GLFW_KEY_K
	KeyL            Key = C.GLFW_KEY_L
	KeyM            Key = C.GLFW_KEY_M
	KeyN            Key = C.GLFW_KEY_N
	KeyO            Key = C.GLFW_KEY_O
	KeyP            Key = C.GLFW_KEY_P
	KeyQ            Key = C.GLFW_KEY_Q
	KeyR            Key = C.GLFW_KEY_R
	KeyS            Key = C.GLFW_KEY_S
	KeyT            Key = C.GLFW_KEY_T
	KeyU            Key = C.GLFW_KEY_U
	KeyV            Key = C.GLFW_KEY_V
	KeyW            Key = C.GLFW_KEY_W
	KeyX            Key = C.GLFW_KEY_X
	KeyY            Key = C.GLFW_KEY_Y
	KeyZ            Key = C.GLFW_KEY_Z
	KeyLeftBracket  Key = C.GLFW_KEY_LEFT_BRACKET
	KeyBackslash    Key = C.GLFW_KEY_BACKSLASH
	KeyRightBracket Key = C.GLFW_KEY_RIGHT_BRACKET
	KeyGraveAccent  Key = C.GLFW_KEY_GRAVE_ACCENT
	KeyWorld1       Key = C.GLFW_KEY_WORLD_1
	KeyWorld2       Key = C.GLFW_KEY_WORLD_2
	KeyEscape       Key = C.GLFW_KEY_ESCAPE
	KeyEnter        Key = C.GLFW_KEY_ENTER
	KeyTab          Key = C.GLFW_KEY_TAB
	KeyBackspace    Key = C.GLFW_KEY_BACKSPACE
	KeyInsert       Key = C.GLFW_KEY_INSERT
	KeyDelete       Key = C.GLFW_KEY_DELETE
	KeyRight        Key = C.GLFW_KEY_RIGHT
	KeyLeft         Key = C.GLFW_KEY_LEFT
	KeyDown         Key = C.GLFW_KEY_DOWN
	KeyUp           Key = C.GLFW_KEY_UP
	KeyPageUp       Key = C.GLFW_KEY_PAGE_UP
	KeyPageDown     Key = C.GLFW_KEY_PAGE_DOWN
	KeyHome         Key = C.GLFW_KEY_HOME
	KeyEnd          Key = C.GLFW_KEY_END
	KeyCapsLock     Key = C.GLFW_KEY_CAPS_LOCK
	KeyScrollLock   Key = C.GLFW_KEY_SCROLL_LOCK
	KeyNumLock      Key = C.GLFW_KEY_NUM_LOCK
	KeyPrintScreen  Key = C.GLFW_KEY_PRINT_SCREEN
	KeyPause        Key = C.GLFW_KEY_PAUSE
	KeyF1           Key = C.GLFW_KEY_F1
	KeyF2           Key = C.GLFW_KEY_F2
	KeyF3           Key = C.GLFW_KEY_F3
	KeyF4           Key = C.GLFW_KEY_F4
	KeyF5           Key = C.GLFW_KEY_F5
	KeyF6           Key = C.GLFW_KEY_F6
	KeyF7           Key = C.GLFW_KEY_F7
	KeyF8           Key = C.GLFW_KEY_F8
	KeyF9           Key = C.GLFW_KEY_F9
	KeyF10          Key = C.GLFW_KEY_F10
	KeyF11          Key = C.GLFW_KEY_F11
	KeyF12          Key = C.GLFW_KEY_F12
	KeyF13          Key = C.GLFW_KEY_F13
	KeyF14          Key = C.GLFW_KEY_F14
	KeyF15          Key = C.GLFW_KEY_F15
	KeyF16          Key = C.GLFW_KEY_F16
	KeyF17          Key = C.GLFW_KEY_F17
	KeyF18          Key = C.GLFW_KEY_F18
	KeyF19          Key = C.GLFW_KEY_F19
	KeyF20          Key = C.GLFW_KEY_F20
	KeyF21          Key = C.GLFW_KEY_F21
	KeyF22          Key = C.GLFW_KEY_F22
	KeyF23          Key = C.GLFW_KEY_F23
	KeyF24          Key = C.GLFW_KEY_F24
	KeyF25          Key = C.GLFW_KEY_F25
	KeyKP0          Key = C.GLFW_KEY_KP_0
	KeyKP1          Key = C.GLFW_KEY_KP_1
	KeyKP2          Key = C.GLFW_KEY_KP_2
	KeyKP3          Key = C.GLFW_KEY_KP_3
	KeyKP4          Key = C.GLFW_KEY_KP_4
	KeyKP5          Key = C.GLFW_KEY_KP_5
	KeyKP6          Key = C.GLFW_KEY_KP_6
	KeyKP7          Key = C.GLFW_KEY_KP_7
	KeyKP8          Key = C.GLFW_KEY_KP_8
	KeyKP9          Key = C.GLFW_KEY_KP_9
	KeyKPDecimal    Key = C.GLFW_KEY_KP_DECIMAL
	KeyKPDivide     Key = C.GLFW_KEY_KP_DIVIDE
	KeyKPMultiply   Key = C.GLFW_KEY_KP_MULTIPLY
	KeyKPSubtract   Key = C.GLFW_KEY_KP_SUBTRACT
	KeyKPAdd        Key = C.GLFW_KEY_KP_ADD
	KeyKPEnter      Key = C.GLFW_KEY_KP_ENTER
	KeyKPEqual      Key = C.GLFW_KEY_KP_EQUAL
	KeyLeftShift    Key = C.GLFW_KEY_LEFT_SHIFT
	KeyLeftControl  Key = C.GLFW_KEY_LEFT_CONTROL
	KeyLeftAlt      Key = C.GLFW_KEY_LEFT_ALT
	KeyLeftSuper    Key = C.GLFW_KEY_LEFT_SUPER
	KeyRightShift   Key = C.GLFW_KEY_RIGHT_SHIFT
	KeyRightControl Key = C.GLFW_KEY_RIGHT_CONTROL
	KeyRightAlt     Key = C.GLFW_KEY_RIGHT_ALT
	KeyRightSuper   Key = C.GLFW_KEY_RIGHT_SUPER
	KeyMenu         Key = C.GLFW_KEY_MENU
	KeyLast         Key = C.GLFW_KEY_LAST
)

These key codes are inspired by the USB HID Usage Tables v1.12 (p. 53-60), but re-arranged to map to 7-bit ASCII for printable keys (function keys are put in the 256+ range).

type KeyCallback

type KeyCallback func(w *Window, key Key, scancode int, action Action, mods ModifierKey)

KeyCallback is the key callback.

type ModifierKey

type ModifierKey int

ModifierKey corresponds to a modifier key.

Modifier keys.

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

Monitor represents a monitor.

func GetMonitors

func GetMonitors() []*Monitor

GetMonitors returns a slice of handles for all currently connected monitors.

func GetPrimaryMonitor

func GetPrimaryMonitor() *Monitor

GetPrimaryMonitor returns the primary monitor. This is usually the monitor where elements like the Windows task bar or the OS X menu bar is located.

func (*Monitor) GetGammaRamp

func (m *Monitor) GetGammaRamp() *GammaRamp

GetGammaRamp retrieves the current gamma ramp of the monitor.

func (*Monitor) GetName

func (m *Monitor) GetName() string

GetName returns a human-readable name of the monitor, encoded as UTF-8.

func (*Monitor) GetPhysicalSize

func (m *Monitor) GetPhysicalSize() (width, height int)

GetPhysicalSize returns the size, in millimetres, of the display area of the monitor.

Note: Some operating systems do not provide accurate information, either because the monitor's EDID data is incorrect, or because the driver does not report it accurately.

func (*Monitor) GetPos

func (m *Monitor) GetPos() (x, y int)

GetPos returns the position, in screen coordinates, of the upper-left corner of the monitor.

func (*Monitor) GetVideoMode

func (m *Monitor) GetVideoMode() *VidMode

GetVideoMode returns the current video mode of the monitor. If you are using a full screen window, the return value will therefore depend on whether it is focused.

func (*Monitor) GetVideoModes

func (m *Monitor) GetVideoModes() []*VidMode

GetVideoModes returns an array of all video modes supported by the monitor. The returned array is sorted in ascending order, first by color bit depth (the sum of all channel depths) and then by resolution area (the product of width and height).

func (*Monitor) GetX11Adapter

func (m *Monitor) GetX11Adapter() C.RRCrtc

GetX11Adapter returns the RRCrtc of the monitor.

func (*Monitor) GetX11Monitor

func (m *Monitor) GetX11Monitor() C.RROutput

GetX11Monitor returns the RROutput of the monitor.

func (*Monitor) SetGamma

func (m *Monitor) SetGamma(gamma float32)

SetGamma generates a 256-element gamma ramp from the specified exponent and then calls SetGamma with it.

func (*Monitor) SetGammaRamp

func (m *Monitor) SetGammaRamp(ramp *GammaRamp)

SetGammaRamp sets the current gamma ramp for the monitor.

type MonitorEvent

type MonitorEvent int

MonitorEvent corresponds to a monitor configuration event.

const (
	Connected    MonitorEvent = C.GLFW_CONNECTED
	Disconnected MonitorEvent = C.GLFW_DISCONNECTED
)

Monitor events.

type MouseButton

type MouseButton int

MouseButton corresponds to a mouse button.

type MouseButtonCallback

type MouseButtonCallback func(w *Window, button MouseButton, action Action, mod ModifierKey)

MouseButtonCallback is the mouse button callback.

type PosCallback

type PosCallback func(w *Window, xpos int, ypos int)

PosCallback is the window position callback.

type RefreshCallback

type RefreshCallback func(w *Window)

RefreshCallback is the window refresh callback.

type ScrollCallback

type ScrollCallback func(w *Window, xoff float64, yoff float64)

ScrollCallback is the scroll callback.

type SizeCallback

type SizeCallback func(w *Window, width int, height int)

SizeCallback is the window size callback.

type StandardCursor

type StandardCursor int

StandardCursor corresponds to a standard cursor icon.

Standard cursors

type VidMode

type VidMode struct {
	Width       int // The width, in pixels, of the video mode.
	Height      int // The height, in pixels, of the video mode.
	RedBits     int // The bit depth of the red channel of the video mode.
	GreenBits   int // The bit depth of the green channel of the video mode.
	BlueBits    int // The bit depth of the blue channel of the video mode.
	RefreshRate int // The refresh rate, in Hz, of the video mode.
}

VidMode describes a single video mode.

type Window

type Window struct {
	// contains filtered or unexported fields
}

Window represents a window.

func CreateWindow

func CreateWindow(width, height int, title string, monitor *Monitor, share *Window) (*Window, error)

CreateWindow creates a window and its associated context. Most of the options controlling how the window and its context should be created are specified through Hint.

Successful creation does not change which context is current. Before you can use the newly created context, you need to make it current using MakeContextCurrent.

Note that the created window and context may differ from what you requested, as not all parameters and hints are hard constraints. This includes the size of the window, especially for full screen windows. To retrieve the actual attributes of the created window and context, use queries like GetWindowAttrib and GetWindowSize.

To create the window at a specific position, make it initially invisible using the Visible window hint, set its position and then show it.

If a fullscreen window is active, the screensaver is prohibited from starting.

Windows: If the executable has an icon resource named GLFW_ICON, it will be set as the icon for the window. If no such icon is present, the IDI_WINLOGO icon will be used instead.

Mac OS X: The GLFW window has no icon, as it is not a document window, but the dock icon will be the same as the application bundle's icon. Also, the first time a window is opened the menu bar is populated with common commands like Hide, Quit and About. The (minimal) about dialog uses information from the application's bundle. For more information on bundles, see the Bundle Programming Guide provided by Apple.

This function may only be called from the main thread.

func GetCurrentContext

func GetCurrentContext() *Window

GetCurrentContext returns the window whose context is current.

func GoWindow

func GoWindow(window unsafe.Pointer) *Window

GoWindow creates a Window from a *C.GLFWwindow reference. Used when an external C library is calling your Go handlers.

func (*Window) Destroy

func (w *Window) Destroy()

Destroy destroys the specified window and its context. On calling this function, no further callbacks will be called for that window.

This function may only be called from the main thread.

func (*Window) Focus

func (w *Window) Focus() error

Focus brings the specified window to front and sets input focus. The window should already be visible and not iconified.

By default, both windowed and full screen mode windows are focused when initially created. Set the glfw.Focused to disable this behavior.

Do not use this function to steal focus from other applications unless you are certain that is what the user wants. Focus stealing can be extremely disruptive.

func (*Window) GLFWWindow

func (w *Window) GLFWWindow() uintptr

GLFWWindow returns a *C.GLFWwindow reference (i.e. the GLFW window itself). This can be used for passing the GLFW window handle to external C libraries.

func (*Window) GetAttrib

func (w *Window) GetAttrib(attrib Hint) int

GetAttrib returns an attribute of the window. There are many attributes, some related to the window and others to its context.

func (*Window) GetClipboardString

func (w *Window) GetClipboardString() (string, error)

GetClipboardString returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string.

This function may only be called from the main thread.

func (*Window) GetCursorPos

func (w *Window) GetCursorPos() (x, y float64)

GetCursorPos returns the last reported position of the cursor.

If the cursor is disabled (with CursorDisabled) then the cursor position is unbounded and limited only by the minimum and maximum values of a double.

The coordinate can be converted to their integer equivalents with the floor function. Casting directly to an integer type works for positive coordinates, but fails for negative ones.

func (*Window) GetFrameSize

func (w *Window) GetFrameSize() (left, top, right, bottom int)

GetFrameSize retrieves the size, in screen coordinates, of each edge of the frame of the specified window. This size includes the title bar, if the window has one. The size of the frame may vary depending on the window-related hints used to create it.

Because this function retrieves the size of each window frame edge and not the offset along a particular coordinate axis, the retrieved values will always be zero or positive.

func (*Window) GetFramebufferSize

func (w *Window) GetFramebufferSize() (width, height int)

GetFramebufferSize retrieves the size, in pixels, of the framebuffer of the specified window.

func (*Window) GetGLXContext

func (w *Window) GetGLXContext() C.GLXContext

GetGLXContext returns the GLXContext of the window.

func (*Window) GetGLXWindow

func (w *Window) GetGLXWindow() C.GLXWindow

GetGLXWindow returns the GLXWindow of the window.

func (*Window) GetInputMode

func (w *Window) GetInputMode(mode InputMode) int

GetInputMode returns the value of an input option of the window.

func (*Window) GetKey

func (w *Window) GetKey(key Key) Action

GetKey returns the last reported state of a keyboard key. The returned state is one of Press or Release. The higher-level state Repeat is only reported to the key callback.

If the StickyKeys input mode is enabled, this function returns Press the first time you call this function after a key has been pressed, even if the key has already been released.

The key functions deal with physical keys, with key tokens named after their use on the standard US keyboard layout. If you want to input text, use the Unicode character callback instead.

func (*Window) GetMonitor

func (w *Window) GetMonitor() *Monitor

GetMonitor returns the handle of the monitor that the window is in fullscreen on.

Returns nil if the window is in windowed mode.

func (*Window) GetMouseButton

func (w *Window) GetMouseButton(button MouseButton) Action

GetMouseButton returns the last state reported for the specified mouse button.

If the StickyMouseButtons input mode is enabled, this function returns Press the first time you call this function after a mouse button has been pressed, even if the mouse button has already been released.

func (*Window) GetPos

func (w *Window) GetPos() (x, y int)

GetPos returns the position, in screen coordinates, of the upper-left corner of the client area of the window.

func (*Window) GetSize

func (w *Window) GetSize() (width, height int)

GetSize returns the size, in screen coordinates, of the client area of the specified window.

func (*Window) GetUserPointer

func (w *Window) GetUserPointer() unsafe.Pointer

GetUserPointer returns the current value of the user-defined pointer of the window. The initial value is nil.

func (*Window) GetX11Window

func (w *Window) GetX11Window() C.Window

GetX11Window returns the Window of the window.

func (*Window) Hide

func (w *Window) Hide()

Hide hides the window, if it was previously visible. If the window is already hidden or is in full screen mode, this function does nothing.

This function may only be called from the main thread.

func (*Window) Iconify

func (w *Window) Iconify() error

Iconify iconifies/minimizes the window, if it was previously restored. If it is a full screen window, the original monitor resolution is restored until the window is restored. If the window is already iconified, this function does nothing.

This function may only be called from the main thread.

func (*Window) MakeContextCurrent

func (w *Window) MakeContextCurrent()

MakeContextCurrent makes the context of the window current. Originally GLFW 3 passes a null pointer to detach the context. But since we're using receievers, DetachCurrentContext should be used instead.

func (*Window) Maximize

func (w *Window) Maximize() error

Maximize maximizes the specified window if it was previously not maximized. If the window is already maximized, this function does nothing.

If the specified window is a full screen window, this function does nothing.

func (*Window) Restore

func (w *Window) Restore() error

Restore restores the window, if it was previously iconified/minimized. If it is a full screen window, the resolution chosen for the window is restored on the selected monitor. If the window is already restored, this function does nothing.

This function may only be called from the main thread.

func (*Window) SetAspectRatio

func (w *Window) SetAspectRatio(numer, denom int)

SetAspectRatio sets the required aspect ratio of the client area of the specified window. If the window is full screen or not resizable, this function does nothing.

The aspect ratio is specified as a numerator and a denominator and both values must be greater than zero. For example, the common 16:9 aspect ratio is specified as 16 and 9, respectively.

If the numerator and denominator is set to glfw.DontCare then the aspect ratio limit is disabled.

The aspect ratio is applied immediately and may cause the window to be resized.

func (*Window) SetCharCallback

func (w *Window) SetCharCallback(cbfun CharCallback) (previous CharCallback)

SetCharCallback sets the character callback which is called when a Unicode character is input.

The character callback is intended for Unicode text input. As it deals with characters, it is keyboard layout dependent, whereas the key callback is not. Characters do not map 1:1 to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key was pressed or released, see the key callback instead.

The character callback behaves as system text input normally does and will not be called if modifier keys are held down that would prevent normal text input on that platform, for example a Super (Command) key on OS X or Alt key on Windows. There is a character with modifiers callback that receives these events.

func (*Window) SetCharModsCallback

func (w *Window) SetCharModsCallback(cbfun CharModsCallback) (previous CharModsCallback)

SetCharModsCallback sets the character with modifiers callback which is called when a Unicode character is input regardless of what modifier keys are used.

The character with modifiers callback is intended for implementing custom Unicode character input. For regular Unicode text input, see the character callback. Like the character callback, the character with modifiers callback deals with characters and is keyboard layout dependent. Characters do not map 1:1 to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key was pressed or released, see the key callback instead.

func (*Window) SetClipboardString

func (w *Window) SetClipboardString(str string)

SetClipboardString sets the system clipboard to the specified UTF-8 encoded string.

This function may only be called from the main thread.

func (*Window) SetCloseCallback

func (w *Window) SetCloseCallback(cbfun CloseCallback) (previous CloseCallback)

SetCloseCallback sets the close callback of the window, which is called when the user attempts to close the window, for example by clicking the close widget in the title bar.

The close flag is set before this callback is called, but you can modify it at any time with SetShouldClose.

Mac OS X: Selecting Quit from the application menu will trigger the close callback for all windows.

func (*Window) SetCursor

func (w *Window) SetCursor(c *Cursor)

SetCursor sets the cursor image to be used when the cursor is over the client area of the specified window. The set cursor will only be visible when the cursor mode of the window is CursorNormal.

On some platforms, the set cursor may not be visible unless the window also has input focus.

func (*Window) SetCursorEnterCallback

func (w *Window) SetCursorEnterCallback(cbfun CursorEnterCallback) (previous CursorEnterCallback)

SetCursorEnterCallback the cursor boundary crossing callback which is called when the cursor enters or leaves the client area of the window.

func (*Window) SetCursorPos

func (w *Window) SetCursorPos(xpos, ypos float64)

SetCursorPos sets the position of the cursor. The specified window must be focused. If the window does not have focus when this function is called, it fails silently.

If the cursor is disabled (with CursorDisabled) then the cursor position is unbounded and limited only by the minimum and maximum values of a double.

func (*Window) SetCursorPosCallback

func (w *Window) SetCursorPosCallback(cbfun CursorPosCallback) (previous CursorPosCallback)

SetCursorPosCallback sets the cursor position callback which is called when the cursor is moved. The callback is provided with the position relative to the upper-left corner of the client area of the window.

func (*Window) SetDropCallback

func (w *Window) SetDropCallback(cbfun DropCallback) (previous DropCallback)

SetDropCallback sets the drop callback which is called when an object is dropped over the window.

func (*Window) SetFocusCallback

func (w *Window) SetFocusCallback(cbfun FocusCallback) (previous FocusCallback)

SetFocusCallback sets the focus callback of the window, which is called when the window gains or loses focus.

After the focus callback is called for a window that lost focus, synthetic key and mouse button release events will be generated for all such that had been pressed. For more information, see SetKeyCallback and SetMouseButtonCallback.

func (*Window) SetFramebufferSizeCallback

func (w *Window) SetFramebufferSizeCallback(cbfun FramebufferSizeCallback) (previous FramebufferSizeCallback)

SetFramebufferSizeCallback sets the framebuffer resize callback of the specified window, which is called when the framebuffer of the specified window is resized.

func (*Window) SetIcon

func (w *Window) SetIcon(images []image.Image)

SetIcon sets the icon of the specified window. If passed an array of candidate images, those of or closest to the sizes desired by the system are selected. If no images are specified, the window reverts to its default icon.

The image is ideally provided in the form of *image.NRGBA. The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel with the red channel first. They are arranged canonically as packed sequential rows, starting from the top-left corner. If the image type is not *image.NRGBA, it will be converted to it.

The desired image sizes varies depending on platform and system settings. The selected images will be rescaled as needed. Good sizes include 16x16, 32x32 and 48x48.

func (*Window) SetIconifyCallback

func (w *Window) SetIconifyCallback(cbfun IconifyCallback) (previous IconifyCallback)

SetIconifyCallback sets the iconification callback of the window, which is called when the window is iconified or restored.

func (*Window) SetInputMode

func (w *Window) SetInputMode(mode InputMode, value int)

SetInputMode sets an input option for the window.

func (*Window) SetKeyCallback

func (w *Window) SetKeyCallback(cbfun KeyCallback) (previous KeyCallback)

SetKeyCallback sets the key callback which is called when a key is pressed, repeated or released.

The key functions deal with physical keys, with layout independent key tokens named after their values in the standard US keyboard layout. If you want to input text, use the SetCharCallback instead.

When a window loses focus, it will generate synthetic key release events for all pressed keys. You can tell these events from user-generated events by the fact that the synthetic ones are generated after the window has lost focus, i.e. Focused will be false and the focus callback will have already been called.

func (*Window) SetMonitor

func (w *Window) SetMonitor(monitor *Monitor, xpos, ypos, width, height, refreshRate int)

SetMonitor sets the monitor that the window uses for full screen mode or, if the monitor is NULL, makes it windowed mode.

When setting a monitor, this function updates the width, height and refresh rate of the desired video mode and switches to the video mode closest to it. The window position is ignored when setting a monitor.

When the monitor is NULL, the position, width and height are used to place the window client area. The refresh rate is ignored when no monitor is specified. If you only wish to update the resolution of a full screen window or the size of a windowed mode window, see window.SetSize.

When a window transitions from full screen to windowed mode, this function restores any previous window settings such as whether it is decorated, floating, resizable, has size or aspect ratio limits, etc..

func (*Window) SetMouseButtonCallback

func (w *Window) SetMouseButtonCallback(cbfun MouseButtonCallback) (previous MouseButtonCallback)

SetMouseButtonCallback sets the mouse button callback which is called when a mouse button is pressed or released.

When a window loses focus, it will generate synthetic mouse button release events for all pressed mouse buttons. You can tell these events from user-generated events by the fact that the synthetic ones are generated after the window has lost focus, i.e. Focused will be false and the focus callback will have already been called.

func (*Window) SetPos

func (w *Window) SetPos(xpos, ypos int)

SetPos sets the position, in screen coordinates, of the upper-left corner of the client area of the window.

If it is a full screen window, this function does nothing.

If you wish to set an initial window position you should create a hidden window (using Hint and Visible), set its position and then show it.

It is very rarely a good idea to move an already visible window, as it will confuse and annoy the user.

The window manager may put limits on what positions are allowed.

This function may only be called from the main thread.

func (*Window) SetPosCallback

func (w *Window) SetPosCallback(cbfun PosCallback) (previous PosCallback)

SetPosCallback sets the position callback of the window, which is called when the window is moved. The callback is provided with the screen position of the upper-left corner of the client area of the window.

func (*Window) SetRefreshCallback

func (w *Window) SetRefreshCallback(cbfun RefreshCallback) (previous RefreshCallback)

SetRefreshCallback sets the refresh callback of the window, which is called when the client area of the window needs to be redrawn, for example if the window has been exposed after having been covered by another window.

On compositing window systems such as Aero, Compiz or Aqua, where the window contents are saved off-screen, this callback may be called only very infrequently or never at all.

func (*Window) SetScrollCallback

func (w *Window) SetScrollCallback(cbfun ScrollCallback) (previous ScrollCallback)

SetScrollCallback sets the scroll callback which is called when a scrolling device is used, such as a mouse wheel or scrolling area of a touchpad.

func (*Window) SetShouldClose

func (w *Window) SetShouldClose(value bool)

SetShouldClose sets the value of the close flag of the window. This can be used to override the user's attempt to close the window, or to signal that it should be closed.

func (*Window) SetSize

func (w *Window) SetSize(width, height int)

SetSize sets the size, in screen coordinates, of the client area of the window.

For full screen windows, this function selects and switches to the resolution closest to the specified size, without affecting the window's context. As the context is unaffected, the bit depths of the framebuffer remain unchanged.

The window manager may put limits on what window sizes are allowed.

This function may only be called from the main thread.

func (*Window) SetSizeCallback

func (w *Window) SetSizeCallback(cbfun SizeCallback) (previous SizeCallback)

SetSizeCallback sets the size callback of the window, which is called when the window is resized. The callback is provided with the size, in screen coordinates, of the client area of the window.

func (*Window) SetSizeLimits

func (w *Window) SetSizeLimits(minw, minh, maxw, maxh int)

SetSizeLimits sets the size limits of the client area of the specified window. If the window is full screen or not resizable, this function does nothing.

The size limits are applied immediately and may cause the window to be resized.

func (*Window) SetTitle

func (w *Window) SetTitle(title string)

SetTitle sets the window title, encoded as UTF-8, of the window.

This function may only be called from the main thread.

func (*Window) SetUserPointer

func (w *Window) SetUserPointer(pointer unsafe.Pointer)

SetUserPointer sets the user-defined pointer of the window. The current value is retained until the window is destroyed. The initial value is nil.

func (*Window) ShouldClose

func (w *Window) ShouldClose() bool

ShouldClose reports the value of the close flag of the specified window.

func (*Window) Show

func (w *Window) Show()

Show makes the window visible, if it was previously hidden. If the window is already visible or is in full screen mode, this function does nothing.

This function may only be called from the main thread.

func (*Window) SwapBuffers

func (w *Window) SwapBuffers()

SwapBuffers swaps the front and back buffers of the window. If the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before swapping the buffers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL