예제 #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))
}
예제 #2
0
파일: surface.go 프로젝트: willemvds/sdl
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
}
예제 #3
0
파일: surface.go 프로젝트: JalfResi/go-sdl2
func (surface *Surface) SaveBMP_RW(dst *RWops, freeDst int) int {
	return int(C.SDL_SaveBMP_RW(surface.cptr(), dst.cptr(), C.int(freeDst)))
}
예제 #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))
}
예제 #5
0
파일: surface.go 프로젝트: emlai/go-sdl2
// 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
}