Пример #1
0
// Open opens a new OS window via GLFW.
func Open(width, height int, title string) (*Window, error) {
	var wnd *glfw3.Window
	errc := make(chan error)
	mainc <- func() {
		var err error
		wnd, err = glfw3.CreateWindow(width, height, title, nil, nil)
		errc <- err
		if err == nil {
			wnd.SetInputMode(glfw3.Cursor, glfw3.CursorNormal)
			wnd.Restore()
		}
	}
	err := <-errc
	if err != nil {
		return nil, err
	}
	return openFromWindow(wnd)
}