func GetCurrentDisplayMode(i int) (*DisplayMode, error) { var dm DisplayMode if C.SDL_GetCurrentDisplayMode(C.int(i), dm.c()) != 0 { return nil, getError() } return &dm, nil }
func NewSurface(w, h int) (*Surface, error) { var curr C.SDL_DisplayMode if C.SDL_GetCurrentDisplayMode(0, &curr) != 0 { return nil, sdlerr() } pixfmt := C.SDL_AllocFormat(curr.format) s := C.SDL_CreateRGBSurface(0, C.int(w), C.int(h), C.int(pixfmt.BitsPerPixel), pixfmt.Rmask, pixfmt.Gmask, pixfmt.Bmask, pixfmt.Amask) if s == nil { return nil, sdlerr() } surf := &Surface{s, pixfmt} runtime.SetFinalizer(surf, freesurf) return surf, nil }
func GetCurrentDisplayMode(displayIndex int, mode *DisplayMode) int { _displayIndex := (C.int)(displayIndex) _mode := (*C.SDL_DisplayMode)(unsafe.Pointer(mode)) return (int)(C.SDL_GetCurrentDisplayMode(_displayIndex, _mode)) }
// GetCurrentDisplayMode (https://wiki.libsdl.org/SDL_GetCurrentDisplayMode) func GetCurrentDisplayMode(displayIndex int, mode *DisplayMode) error { if C.SDL_GetCurrentDisplayMode(C.int(displayIndex), mode.cptr()) != 0 { return GetError() } return nil }
func GetCurrentDisplayMode(displayIndex int, mode *DisplayMode) int { return int(C.SDL_GetCurrentDisplayMode(C.int(displayIndex), mode.cptr())) }