zntg/allg5/graphics.go

26 lines
918 B
Go
Raw Normal View History

2018-11-21 13:35:14 +00:00
package allg5
// #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))
}