Exemplo n.º 1
0
func CreatePbufferSurface(
	disp Display, config Config, attribList *int32) Surface {
	return Surface(C.eglCreatePbufferSurface(
		C.EGLDisplay(unsafe.Pointer(disp)),
		C.EGLConfig(unsafe.Pointer(config)),
		(*C.EGLint)(attribList)))
}
Exemplo n.º 2
0
func (display *Display) CreatePbufferSurface(config Config, attribList []Attrib) (*Surface, error) {
	var eglAttribs *C.EGLint
	if attribList != nil {
		eglAttribs = (*C.EGLint)(&(attribList[0]))
	}

	eglSurface := C.eglCreatePbufferSurface(display.eglDisplay, C.EGLConfig(config), eglAttribs)
	if eglSurface == noSurface {
		return nil, getError()
	}

	surface := new(Surface)
	//runtime.SetFinalizer(surface, destroySurface)
	surface.Display = display
	surface.eglSurface = eglSurface
	return surface, nil
}