示例#1
0
文件: display.go 项目: foobaz/egl
/*
 * WARNING: this method does not work with Mesa as of
 * version 8.x. Their implementation violates the EGL
 * specification and does not allow you to release a context.
 */
func (display *Display) ReleaseCurrentContext() error {
	success := C.eglMakeCurrent(display.eglDisplay, noSurface, noSurface, noContext)
	if success == C.EGL_FALSE {
		return getError()
	}
	return nil
}
示例#2
0
func MakeCurrent(
	disp Display, draw Surface,
	read Surface, ctx Context) bool {
	return goBoolean(C.eglMakeCurrent(
		C.EGLDisplay(unsafe.Pointer(disp)),
		C.EGLSurface(unsafe.Pointer(draw)),
		C.EGLSurface(unsafe.Pointer(read)),
		C.EGLContext(unsafe.Pointer(ctx))))
}
示例#3
0
文件: context.go 项目: foobaz/egl
func (context *Context) MakeCurrent(draw *Surface, read *Surface) error {
	var eglDraw C.EGLSurface
	if draw == nil {
		eglDraw = noSurface
	} else {
		eglDraw = draw.eglSurface
	}

	var eglRead C.EGLSurface
	if read == nil {
		eglRead = noSurface
	} else {
		eglRead = read.eglSurface
	}

	success := C.eglMakeCurrent(context.Display.eglDisplay, eglDraw, eglRead, context.eglContext)
	if success == C.EGL_FALSE {
		return getError()
	}
	return nil
}