Example #1
0
func (w *Window) LockSize(lock bool) {
	// glfw supports only window size locking when the
	// parameter is set before the creation of the window.
	// It doesn't work on an existing window.
	if lock {
		glfw.WindowHint(glfw.Resizable, glfw.False)
	} else {
		glfw.WindowHint(glfw.Resizable, glfw.True)
	}
}
Example #2
0
func init() {
	wde.BackendNewWindow = func(width, height int) (w wde.Window, err error) {
		var window *Window
		window, err = NewWindow(width, height)
		w = window
		return
	}

	wde.BackendRun = glfw.Main

	wde.BackendStop = func() {
		glfw.Terminate()
		os.Exit(0)
	}

	go doRun()

	// Don't show the window context before using the Show function.
	go glfw.WindowHint(glfw.Visible, glfw.False)

	go flushBuffer()

	go setGlyph()
}