func (w *Window) Hide() {
	C.glfwHideWindow(w.data)
	panicError()
}
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.
package glfw
import "C"
import (
	"sync"
	"unsafe"
)
type windowList struct {
	l sync.Mutex
	m map[*C.GLFWwindow]*Window
}
var windows = windowList{m: map[*C.GLFWwindow]*Window{}}
func (w *windowList) put(wnd *Window) {
	w.l.Lock()
	defer w.l.Unlock()
	w.m[wnd.data] = wnd
}
func (w *windowList) remove(wnd *C.GLFWwindow) {
	w.l.Lock()
	defer w.l.Unlock()
	delete(w.m, wnd)
}
func (w *windowList) get(wnd *C.GLFWwindow) *Window {
	w.l.Lock()
	defer w.l.Unlock()
	return w.m[wnd]
}
type Hint int
const (
	Focused     Hint = C.GLFW_FOCUSED       
	Iconified   Hint = C.GLFW_ICONIFIED     
	Visible     Hint = C.GLFW_VISIBLE       
	Resizable   Hint = C.GLFW_RESIZABLE     
	Decorated   Hint = C.GLFW_DECORATED     
	Floating    Hint = C.GLFW_FLOATING      
	AutoIconify Hint = C.GLFW_AUTO_ICONIFY  
)
const (
	ClientAPI               Hint = C.GLFW_CLIENT_API                
	ContextVersionMajor     Hint = C.GLFW_CONTEXT_VERSION_MAJOR     
	ContextVersionMinor     Hint = C.GLFW_CONTEXT_VERSION_MINOR     
	ContextRobustness       Hint = C.GLFW_CONTEXT_ROBUSTNESS        
	ContextReleaseBehavior  Hint = C.GLFW_CONTEXT_RELEASE_BEHAVIOR  
	OpenGLForwardCompatible Hint = C.GLFW_OPENGL_FORWARD_COMPAT     
	OpenGLDebugContext      Hint = C.GLFW_OPENGL_DEBUG_CONTEXT      
	OpenGLProfile           Hint = C.GLFW_OPENGL_PROFILE            
)
const (
	ContextRevision Hint = C.GLFW_CONTEXT_REVISION
	RedBits         Hint = C.GLFW_RED_BITS          
	GreenBits       Hint = C.GLFW_GREEN_BITS        
	BlueBits        Hint = C.GLFW_BLUE_BITS         
	AlphaBits       Hint = C.GLFW_ALPHA_BITS        
	DepthBits       Hint = C.GLFW_DEPTH_BITS        
	StencilBits     Hint = C.GLFW_STENCIL_BITS      
	AccumRedBits    Hint = C.GLFW_ACCUM_RED_BITS    
	AccumGreenBits  Hint = C.GLFW_ACCUM_GREEN_BITS  
	AccumBlueBits   Hint = C.GLFW_ACCUM_BLUE_BITS   
	AccumAlphaBits  Hint = C.GLFW_ACCUM_ALPHA_BITS  
	AuxBuffers      Hint = C.GLFW_AUX_BUFFERS       
	Stereo          Hint = C.GLFW_STEREO            
	Samples         Hint = C.GLFW_SAMPLES           
	SRGBCapable     Hint = C.GLFW_SRGB_CAPABLE      
	RefreshRate     Hint = C.GLFW_REFRESH_RATE      
	DoubleBuffer    Hint = C.GLFW_DOUBLEBUFFER      
)
const (
	OpenGLAPI   int = C.GLFW_OPENGL_API
	OpenGLESAPI int = C.GLFW_OPENGL_ES_API
)
const (
	NoRobustness        int = C.GLFW_NO_ROBUSTNESS
	NoResetNotification int = C.GLFW_NO_RESET_NOTIFICATION
	LoseContextOnReset  int = C.GLFW_LOSE_CONTEXT_ON_RESET
)
const (
	AnyReleaseBehavior   int = C.GLFW_ANY_RELEASE_BEHAVIOR
	ReleaseBehaviorFlush int = C.GLFW_RELEASE_BEHAVIOR_FLUSH
	ReleaseBehaviorNone  int = C.GLFW_RELEASE_BEHAVIOR_NONE
)
const (
	OpenGLAnyProfile    int = C.GLFW_OPENGL_ANY_PROFILE
	OpenGLCoreProfile   int = C.GLFW_OPENGL_CORE_PROFILE
	OpenGLCompatProfile int = C.GLFW_OPENGL_COMPAT_PROFILE
)
const (
	True     int = C.GL_TRUE
	False    int = C.GL_FALSE
	DontCare int = C.GLFW_DONT_CARE
)
type Window struct {
	data *C.GLFWwindow
	fPosHolder             func(w *Window, xpos int, ypos int)
	fSizeHolder            func(w *Window, width int, height int)
	fFramebufferSizeHolder func(w *Window, width int, height int)
	fCloseHolder           func(w *Window)
	fRefreshHolder         func(w *Window)
	fFocusHolder           func(w *Window, focused bool)
	fIconifyHolder         func(w *Window, iconified bool)
	fMouseButtonHolder func(w *Window, button MouseButton, action Action, mod ModifierKey)
	fCursorPosHolder   func(w *Window, xpos float64, ypos float64)
	fCursorEnterHolder func(w *Window, entered bool)
	fScrollHolder      func(w *Window, xoff float64, yoff float64)
	fKeyHolder         func(w *Window, key Key, scancode int, action Action, mods ModifierKey)
	fCharHolder        func(w *Window, char rune)
	fCharModsHolder    func(w *Window, char rune, mods ModifierKey)
	fDropHolder        func(w *Window, names []string)
}
func goWindowPosCB(window unsafe.Pointer, xpos, ypos C.int) {
	w := windows.get((*C.GLFWwindow)(window))
	w.fPosHolder(w, int(xpos), int(ypos))
}
func goWindowSizeCB(window unsafe.Pointer, width, height C.int) {
	w := windows.get((*C.GLFWwindow)(window))
	w.fSizeHolder(w, int(width), int(height))
}
func goFramebufferSizeCB(window unsafe.Pointer, width, height C.int) {
	w := windows.get((*C.GLFWwindow)(window))
	w.fFramebufferSizeHolder(w, int(width), int(height))
}
func goWindowCloseCB(window unsafe.Pointer) {
	w := windows.get((*C.GLFWwindow)(window))
	w.fCloseHolder(w)
}
func goWindowRefreshCB(window unsafe.Pointer) {
	w := windows.get((*C.GLFWwindow)(window))
	w.fRefreshHolder(w)
}
func goWindowFocusCB(window unsafe.Pointer, focused C.int) {
	w := windows.get((*C.GLFWwindow)(window))
	isFocused := glfwbool(focused)
	w.fFocusHolder(w, isFocused)
}
func goWindowIconifyCB(window unsafe.Pointer, iconified C.int) {
	isIconified := glfwbool(iconified)
	w := windows.get((*C.GLFWwindow)(window))
	w.fIconifyHolder(w, isIconified)
}
func DefaultWindowHints() {
	C.glfwDefaultWindowHints()
	panicError()
}
func WindowHint(target Hint, hint int) {
	C.glfwWindowHint(C.int(target), C.int(hint))
	panicError()
}
func CreateWindow(width, height int, title string, monitor *Monitor, share *Window) (*Window, error) {
	var (
		m *C.GLFWmonitor
		s *C.GLFWwindow
	)
	t := C.CString(title)
	defer C.free(unsafe.Pointer(t))
	if monitor != nil {
		m = monitor.data
	}
	if share != nil {
		s = share.data
	}
	w := C.glfwCreateWindow(C.int(width), C.int(height), t, m, s)
	if w == nil {
		return nil, acceptError(APIUnavailable, VersionUnavailable)
	}
	wnd := &Window{data: w}
	windows.put(wnd)
	return wnd, nil
}
func (w *Window) Destroy() {
	windows.remove(w.data)
	C.glfwDestroyWindow(w.data)
	panicError()
}
func (w *Window) ShouldClose() bool {
	ret := glfwbool(C.glfwWindowShouldClose(w.data))
	panicError()
	return ret
}
func (w *Window) SetShouldClose(value bool) {
	if !value {
		C.glfwSetWindowShouldClose(w.data, C.GL_FALSE)
	} else {
		C.glfwSetWindowShouldClose(w.data, C.GL_TRUE)
	}
	panicError()
}
func (w *Window) SetTitle(title string) {
	t := C.CString(title)
	defer C.free(unsafe.Pointer(t))
	C.glfwSetWindowTitle(w.data, t)
	panicError()
}
func (w *Window) GetPos() (x, y int) {
	var xpos, ypos C.int
	C.glfwGetWindowPos(w.data, &xpos, &ypos)
	panicError()
	return int(xpos), int(ypos)
}
func (w *Window) SetPos(xpos, ypos int) {
	C.glfwSetWindowPos(w.data, C.int(xpos), C.int(ypos))
	panicError()
}
func (w *Window) GetSize() (width, height int) {
	var wi, h C.int
	C.glfwGetWindowSize(w.data, &wi, &h)
	panicError()
	return int(wi), int(h)
}
func (w *Window) SetSize(width, height int) {
	C.glfwSetWindowSize(w.data, C.int(width), C.int(height))
	panicError()
}
func (w *Window) GetFramebufferSize() (width, height int) {
	var wi, h C.int
	C.glfwGetFramebufferSize(w.data, &wi, &h)
	panicError()
	return int(wi), int(h)
}
func (w *Window) GetFrameSize() (left, top, right, bottom int) {
	var l, t, r, b C.int
	C.glfwGetWindowFrameSize(w.data, &l, &t, &r, &b)
	panicError()
	return int(l), int(t), int(r), int(b)
}
func (w *Window) Iconify() error {
	C.glfwIconifyWindow(w.data)
	return acceptError(APIUnavailable)
}
func (w *Window) Restore() error {
	C.glfwRestoreWindow(w.data)
	return acceptError(APIUnavailable)
}
func (w *Window) Show() {
	C.glfwShowWindow(w.data)
	panicError()
}