Exemple #1
0
func GetClosestDisplayMode(displayIndex int, mode *DisplayMode, closest *DisplayMode) *DisplayMode {
	_displayIndex := (C.int)(displayIndex)
	_mode := (*C.SDL_DisplayMode)(unsafe.Pointer(mode))
	_closest := (*C.SDL_DisplayMode)(unsafe.Pointer(closest))
	return (*DisplayMode)(unsafe.Pointer((C.SDL_GetClosestDisplayMode(_displayIndex,
		_mode, _closest))))
}
Exemple #2
0
// GetClosestDisplayMode (https://wiki.libsdl.org/SDL_GetClosestDisplayMode)
func GetClosestDisplayMode(displayIndex int, mode *DisplayMode, closest *DisplayMode) (*DisplayMode, error) {
	m := (*DisplayMode)(unsafe.Pointer((C.SDL_GetClosestDisplayMode(C.int(displayIndex), mode.cptr(), closest.cptr()))))
	if m == nil {
		return nil, GetError()
	}
	return m, nil
}
Exemple #3
0
func GetClosestDisplayMode(i int, m *DisplayMode) (*DisplayMode, error) {
	var dm DisplayMode
	if C.SDL_GetClosestDisplayMode(C.int(i), m.c(), dm.c()) == nil {
		return nil, errors.New("Couldn't find close match")
	}

	return &dm, nil
}
Exemple #4
0
func GetClosestDisplayMode(displayIndex int, mode *DisplayMode, closest *DisplayMode) *DisplayMode {
	return (*DisplayMode)(unsafe.Pointer((C.SDL_GetClosestDisplayMode(C.int(displayIndex), mode.cptr(), closest.cptr()))))
}