Exemple #1
0
func (s *Surface) SaveBMP(_file string) {
	cfile := C.CString(_file)
	defer C.free(unsafe.Pointer(cfile))
	cparams := C.CString("wb")
	defer C.free(unsafe.Pointer(cparams))
	C.SDL_SaveBMP_RW(s.Get(), C.SDL_RWFromFile(cfile, cparams), C.int(1))
}
Exemple #2
0
func SaveBMP_RW(s *Surface, rw *RWops, free bool) error {
	var cfree C.int
	if free {
		cfree = 1
	}

	if C.SDL_SaveBMP_RW(s.c(), rw.c, cfree) != 0 {
		return getError()
	}

	return nil
}
Exemple #3
0
func (surface *Surface) SaveBMP_RW(dst *RWops, freeDst int) int {
	return int(C.SDL_SaveBMP_RW(surface.cptr(), dst.cptr(), C.int(freeDst)))
}
Exemple #4
0
func (surface *Surface) SaveBMP_RW(dst *RWops, freedst int) int {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	_dst := (*C.SDL_RWops)(unsafe.Pointer(dst))
	_freedst := (C.int)(freedst)
	return (int)(C.SDL_SaveBMP_RW(_surface, _dst, _freedst))
}
Exemple #5
0
// Surface (https://wiki.libsdl.org/SDL_SaveBMP_RW)
func (surface *Surface) SaveBMP_RW(dst *RWops, freeDst int) error {
	if C.SDL_SaveBMP_RW(surface.cptr(), dst.cptr(), C.int(freeDst)) != 0 {
		return GetError()
	}
	return nil
}