Ejemplo n.º 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
}
Ejemplo n.º 2
0
// 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)))
}
Ejemplo n.º 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))))
}