Example #1
0
func (display *Display) GetConfigs() ([]Config, error) {
	var configCount C.EGLint
	success := C.eglGetConfigs(display.eglDisplay, nil, 0, &configCount)
	if success == C.EGL_FALSE {
		return nil, getError()
	}

	if configCount <= 0 {
		configCount = 10
	}
	configurations := make([]Config, configCount)
	success = C.eglGetConfigs(
		display.eglDisplay,
		(*C.EGLConfig)(&(configurations[0])),
		configCount,
		&configCount)
	if success == C.EGL_FALSE {
		return nil, getError()
	}
	if configCount <= 0 {
		return nil, errors.New("eglGetConfigs() returned zero configs")
	}

	return configurations[:configCount], nil
}
Example #2
0
func GetConfigs(
	disp Display, configs *Config,
	configSize int32, numConfig *int32) bool {
	return goBoolean(C.eglGetConfigs(
		C.EGLDisplay(unsafe.Pointer(disp)),
		(*C.EGLConfig)(unsafe.Pointer(configs)),
		C.EGLint(configSize),
		(*C.EGLint)(unsafe.Pointer(numConfig))))
}