Beispiel #1
0
//GetCurrentContext returns the window whose context is current.
func GetCurrentContext() (*Window, error) {
	w := C.glfwGetCurrentContext()
	if w == nil {
		return nil, errors.New("Current context is not set.")
	}
	return windows.get(w), nil
}
Beispiel #2
0
// GetCurrentContext returns the window whose context is current.
func GetCurrentContext() *Window {
	w := C.glfwGetCurrentContext()
	panicError()
	if w == nil {
		return nil
	}
	return windows.get(w)
}
Beispiel #3
0
func GetCurrentContext() *Window {
	windows.Lock()
	defer windows.Unlock()
	return windows.m[C.glfwGetCurrentContext()]
}
Beispiel #4
0
Datei: glfw.go Projekt: maun/glfw
func CurrentContext() Window {
	return Window(C.glfwGetCurrentContext())
}