Exemple #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
}
Exemple #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)
}
Exemple #3
0
func GetCurrentContext() *Window {
	windows.Lock()
	defer windows.Unlock()
	return windows.m[C.glfwGetCurrentContext()]
}
Exemple #4
0
func CurrentContext() Window {
	return Window(C.glfwGetCurrentContext())
}