mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-03-04 09:11:27 +01:00
add CreateNotPreservedBitmap helper
This commit is contained in:
parent
e0c422972b
commit
d3f876097f
2 changed files with 10 additions and 0 deletions
|
@ -402,3 +402,11 @@ SYMBOL_EXPORT void WindowCoordsToViewport(struct Game *game, int *x, int *y) {
|
||||||
*x /= clipWidth / (float)game->viewport.width;
|
*x /= clipWidth / (float)game->viewport.width;
|
||||||
*y /= clipHeight / (float)game->viewport.height;
|
*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;
|
||||||
|
}
|
||||||
|
|
|
@ -71,4 +71,6 @@ void FatalError(struct Game *game, bool exit, char* format, ...);
|
||||||
void SetupViewport(struct Game *game, struct Viewport config);
|
void SetupViewport(struct Game *game, struct Viewport config);
|
||||||
|
|
||||||
void WindowCoordsToViewport(struct Game *game, int *x, int *y);
|
void WindowCoordsToViewport(struct Game *game, int *x, int *y);
|
||||||
|
|
||||||
|
ALLEGRO_BITMAP* CreateNotPreservedBitmap(int width, int height);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue