Example #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
}
Example #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)
}
Example #3
0
func GetCurrentContext() *Window {
	windows.Lock()
	defer windows.Unlock()
	return windows.m[C.glfwGetCurrentContext()]
}
Example #4
0
File: glfw.go Project: maun/glfw
func CurrentContext() Window {
	return Window(C.glfwGetCurrentContext())
}