2018-09-22 14:23:26 +00:00
|
|
|
package allg5
|
2017-10-03 18:38:09 +00:00
|
|
|
|
|
|
|
// #include <allegro5/allegro.h>
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
// BitmapFlag is extra information provided for creating a bitmap
|
|
|
|
type BitmapFlag int
|
|
|
|
|
|
|
|
const (
|
|
|
|
// BitmapFlagLinearScaleDown enables linear scaling when scaling down. Gives better results when combined with BitmapFlagMipMap
|
|
|
|
BitmapFlagLinearScaleDown BitmapFlag = C.ALLEGRO_MIN_LINEAR
|
|
|
|
// BitmapFlagLinearScaleUp enables linear scaling when scaling up.
|
|
|
|
BitmapFlagLinearScaleUp = C.ALLEGRO_MAG_LINEAR
|
|
|
|
// BitmapFlagMipMap enables mipmaps for drawing a scaled down version. Bitmap must square and its sides must be a power of two.
|
|
|
|
BitmapFlagMipMap = C.ALLEGRO_MIPMAP
|
|
|
|
)
|
|
|
|
|
|
|
|
// ClearToColor clears the target bitmap to the color
|
|
|
|
func ClearToColor(c Color) {
|
|
|
|
C.al_clear_to_color(c.color)
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNewBitmapFlags sets the default bitmap flags for a newly created bitmap
|
|
|
|
func SetNewBitmapFlags(flags BitmapFlag) {
|
|
|
|
C.al_set_new_bitmap_flags(C.int(flags))
|
|
|
|
}
|