Exemplo n.º 1
0
/*
 * 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
}
Exemplo n.º 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))))
}
Exemplo n.º 3
0
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
}