示例#1
0
文件: context.go 项目: godispy/glfw
//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
}
示例#2
0
文件: context.go 项目: godispy/glfw
// GetCurrentContext returns the window whose context is current.
func GetCurrentContext() *Window {
	w := C.glfwGetCurrentContext()
	panicError()
	if w == nil {
		return nil
	}
	return windows.get(w)
}
示例#3
0
文件: glfw.go 项目: gordonklaus/glfw
func GetCurrentContext() *Window {
	windows.Lock()
	defer windows.Unlock()
	return windows.m[C.glfwGetCurrentContext()]
}
示例#4
0
文件: glfw.go 项目: maun/glfw
func CurrentContext() Window {
	return Window(C.glfwGetCurrentContext())
}