summaryrefslogtreecommitdiff
path: root/src/texture.h
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2021-12-23 20:52:49 +0100
committerEkaitz Zarraga <ekaitz@elenq.tech>2021-12-23 20:52:49 +0100
commit35465f27ed87646a18cd9298eae861f14385300e (patch)
tree7f0256d28fa6fd5368b7a39500d080456e70be8e /src/texture.h
First commit: moves a simple thing on the screen
Diffstat (limited to 'src/texture.h')
-rw-r--r--src/texture.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/texture.h b/src/texture.h
new file mode 100644
index 0000000..311db4a
--- /dev/null
+++ b/src/texture.h
@@ -0,0 +1,15 @@
+#include <SDL2/SDL.h>
+#include <string>
+
+class Texture{
+ public:
+ Texture(SDL_Renderer* renderer);
+ ~Texture();
+ int loadFromFile(std::string path);
+ void render(int x, int y, SDL_Rect* clip = nullptr);
+ private:
+ SDL_Texture* texture_;
+ int w_;
+ int h_;
+ SDL_Renderer* renderer_;
+};