mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
SetFramebufferAsTarget: Avoid re-setting the same target bitmap
This commit is contained in:
parent
86fef86257
commit
d26adecc8e
1 changed files with 3 additions and 1 deletions
|
@ -573,7 +573,9 @@ SYMBOL_EXPORT ALLEGRO_BITMAP* GetFramebuffer(struct Game* game) {
|
|||
|
||||
SYMBOL_EXPORT void SetFramebufferAsTarget(struct Game* game) {
|
||||
ALLEGRO_BITMAP* framebuffer = GetFramebuffer(game);
|
||||
al_set_target_bitmap(framebuffer);
|
||||
if (al_get_target_bitmap() != framebuffer) {
|
||||
al_set_target_bitmap(framebuffer);
|
||||
}
|
||||
if (framebuffer != al_get_backbuffer(game->display)) {
|
||||
double x = al_get_bitmap_width(framebuffer) / (double)game->viewport.width;
|
||||
double y = al_get_bitmap_height(framebuffer) / (double)game->viewport.height;
|
||||
|
|
Loading…
Reference in a new issue