add CreateNotPreservedBitmap helper

This commit is contained in:
Sebastian Krzyszkowiak 2017-05-07 01:30:22 +02:00
parent e0c422972b
commit d3f876097f
2 changed files with 10 additions and 0 deletions

View file

@ -402,3 +402,11 @@ SYMBOL_EXPORT void WindowCoordsToViewport(struct Game *game, int *x, int *y) {
*x /= clipWidth / (float)game->viewport.width;
*y /= clipHeight / (float)game->viewport.height;
}
SYMBOL_EXPORT ALLEGRO_BITMAP* CreateNotPreservedBitmap(int width, int height) {
int flags = al_get_new_bitmap_flags();
al_add_new_bitmap_flag(ALLEGRO_NO_PRESERVE_TEXTURE);
ALLEGRO_BITMAP *bitmap = al_create_bitmap(width, height);
al_set_new_bitmap_flags(flags);
return bitmap;
}

View file

@ -71,4 +71,6 @@ void FatalError(struct Game *game, bool exit, char* format, ...);
void SetupViewport(struct Game *game, struct Viewport config);
void WindowCoordsToViewport(struct Game *game, int *x, int *y);
ALLEGRO_BITMAP* CreateNotPreservedBitmap(int width, int height);
#endif