예제 #1
0
func (b *Bitmap) CreateSubBitmap(x, y, w, h int) *Bitmap {
	var sub *Bitmap

	sub = (*Bitmap)(C.al_create_sub_bitmap((*C.ALLEGRO_BITMAP)(b),
		C.int(x), C.int(y), C.int(w), C.int(h)))

	return sub
}
예제 #2
0
파일: bitmap.go 프로젝트: beoran/algo
// Creates a sub bitmap of the given bitmap that will automatically be destoyed
// through a finalizer. However, you must ensure that this destroy happens before the
// parent bitmap is disposed of. You may need to call Destroy manyally anyway.
func (self *Bitmap) CreateSubBitmap(x, y, w, h int) *Bitmap {
	return wrapBitmap(C.al_create_sub_bitmap(self.handle,
		C.int(x), C.int(y), C.int(w), C.int(h)))
}
예제 #3
0
func (b *Bitmap) CreateSub(x, y, w, h int32) *Bitmap {
	return (*Bitmap)(unsafe.Pointer(C.al_create_sub_bitmap((*C.ALLEGRO_BITMAP)(unsafe.Pointer(b)), C.int(x), C.int(y), C.int(w), C.int(h))))
}