Exemple #1
0
// DisplayBounds returns the desktop area represented by a display, with the
// primary display located at 0,0.
func DisplayBounds(displayIndex int) (rect image.Rectangle, err error) {
	var cRect C.SDL_Rect
	if C.SDL_GetDisplayBounds(C.int(displayIndex), &cRect) != 0 {
		return image.ZR, getError()
	}
	return goRect(cRect), nil
}
Exemple #2
0
func GetDisplayBounds(i int) (*Rect, error) {
	var rect Rect
	if C.SDL_GetDisplayBounds(C.int(i), rect.c()) != 0 {
		return nil, getError()
	}

	return &rect, nil
}
Exemple #3
0
// GetDisplayBounds (https://wiki.libsdl.org/SDL_GetDisplayBounds)
func GetDisplayBounds(displayIndex int, rect *Rect) error {
	if C.SDL_GetDisplayBounds(C.int(displayIndex), rect.cptr()) != 0 {
		return GetError()
	}
	return nil
}
Exemple #4
0
func GetDisplayBounds(displayIndex int, rect *Rect) int {
	return int(C.SDL_GetDisplayBounds(C.int(displayIndex), rect.cptr()))
}