Exemplo n.º 1
0
Arquivo: video.go Projeto: salihdb/sdl
// 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
}
Exemplo n.º 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
}
Exemplo n.º 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
}
Exemplo n.º 4
0
func GetDisplayBounds(displayIndex int, rect *Rect) int {
	return int(C.SDL_GetDisplayBounds(C.int(displayIndex), rect.cptr()))
}