diff options
| author | realtradam <[email protected]> | 2022-11-04 19:58:52 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-11-04 19:58:52 -0400 |
| commit | f32e06ab49889b50bba195729af19d3bc878f976 (patch) | |
| tree | 975df20f86f9405e4321dc14265c145b9e876a3e /src/resources.cpp | |
| parent | 4c5b6f580133f9e9c02b5cb2243b43ff15b20304 (diff) | |
| download | orbital_game-f32e06ab49889b50bba195729af19d3bc878f976.tar.gz orbital_game-f32e06ab49889b50bba195729af19d3bc878f976.zip | |
added renderer system
Diffstat (limited to 'src/resources.cpp')
| -rw-r--r-- | src/resources.cpp | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/resources.cpp b/src/resources.cpp index 8a820b5..9d1834a 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -2,7 +2,7 @@ #include <string> #include <stdexcept> #include "raylib.h" -#include "resources.h" +#include "resources.hpp" namespace Resources { static std::unordered_map<std::string, std::string> textureFiles = { @@ -25,30 +25,4 @@ namespace Resources { return texture; } - Sprite::Sprite(std::string texture_name, - Rectangle source_rectangle, - Vector2 origin - ):texture_name(texture_name), - source_rectangle(source_rectangle), - origin(origin){ - - } - - void Sprite::drawPro(Rectangle dest_rectangle, float rotation, Color color) { - DrawTexturePro(useTexture(texture_name), - source_rectangle, - dest_rectangle, - origin, - rotation, - color); - } - - void Sprite::draw(float x, float y, float scale, float rotation, Color color) { - DrawTexturePro(useTexture(texture_name), - source_rectangle, - (Rectangle){x,y,source_rectangle.width * scale,source_rectangle.height * scale}, - origin, - rotation, - color); - } } |
