Extended Display.SetIcon to allow multiple icons.
This commit is contained in:
parent
9002c2b24d
commit
451f389ef6
16
display.go
16
display.go
@ -115,8 +115,20 @@ func (d *Display) SetAsTarget() {
|
||||
C.al_set_target_backbuffer(d.display)
|
||||
}
|
||||
|
||||
func (d *Display) SetIcon(i *Bitmap) {
|
||||
C.al_set_display_icon(d.display, i.bitmap)
|
||||
func (d *Display) SetIcon(i ...*Bitmap) {
|
||||
if len(i) == 0 {
|
||||
return
|
||||
}
|
||||
if len(i) == 1 {
|
||||
C.al_set_display_icon(d.display, i[0].bitmap)
|
||||
return
|
||||
}
|
||||
|
||||
icons := make([]*C.ALLEGRO_BITMAP, len(i))
|
||||
for j := range icons {
|
||||
icons[j] = i[j].bitmap
|
||||
}
|
||||
C.al_set_display_icons(d.display, C.int(len(icons)), &(icons[0]))
|
||||
}
|
||||
|
||||
func (d *Display) SetMouseCursor(c MouseCursor) {
|
||||
|
Loading…
Reference in New Issue
Block a user