diff --git a/src/utils/RaylibDeprecated.cpp b/src/utils/RaylibExtra.cpp similarity index 89% rename from src/utils/RaylibDeprecated.cpp rename to src/utils/RaylibExtra.cpp index 777d5e5..cae7142 100755 --- a/src/utils/RaylibDeprecated.cpp +++ b/src/utils/RaylibExtra.cpp @@ -1,6 +1,5 @@ -#include - #include "Panda.hpp" +#include // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. void panda::DrawTextureTiled(Texture texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint) @@ -84,4 +83,17 @@ void panda::DrawTextureTiled(Texture texture, Rectangle source, Rectangle dest, } } } +} + +void panda::DrawRenderTexture(const RenderTexture &buffer, const float &x, const float &y, const Color &color) +{ + DrawTextureRec( + buffer.texture, + {0.0f, 0.0f, 1.0f*buffer.texture.width, -1.0f*buffer.texture.height}, + {x, y}, color); +} + +Rectangle panda::GetTextureRect(const Texture &tex, bool flipX, bool flipY) +{ + return { 0.0f, 0.0f, (flipX ? -tex.width : tex.width)*1.0f, (flipY ? -tex.height : tex.height)*1.0f }; } \ No newline at end of file