aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Texture.h
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-10-22 15:37:00 +0200
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-10-22 15:37:00 +0200
commitf1857fc2d4ddec71b3f0395903f8446cf96b8d0c (patch)
treefeb0a1b4f80cb67ca9af89545ae67a2c03e2f23b /src/crepe/api/Texture.h
parentb151274f9009eb9f86e4df29ca2c75f5b01d4092 (diff)
fixed everything and can now work with new compiler, example rendering and made it work with component manager
Diffstat (limited to 'src/crepe/api/Texture.h')
-rw-r--r--src/crepe/api/Texture.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/crepe/api/Texture.h b/src/crepe/api/Texture.h
index db2f1f9..b376b44 100644
--- a/src/crepe/api/Texture.h
+++ b/src/crepe/api/Texture.h
@@ -1,31 +1,32 @@
#pragma once
-#include "SDL_rect.h"
-#include "api/baseResource.h"
-#include "api/Resource.h"
+#include "Asset.h"
#include <SDL2/SDL_render.h>
#include <memory>
-namespace crepe {
+namespace crepe {
+ class SdlContext;
+}
+namespace crepe::api {
-class Texture : public api::BaseResource{
+class Texture {
public:
Texture(const char * src);
- Texture(std::unique_ptr<api::Resource> res);
+ Texture(std::unique_ptr<Asset> res);
~Texture();
- SDL_Texture* get_texture() const;
- SDL_Rect& get_rect() ;
+
private:
- void load(std::unique_ptr<api::Resource> res);
+ void load(std::unique_ptr<Asset> res);
+
private:
- SDL_Texture* m_texture;
- SDL_Rect srcrect;
+ SDL_Texture * m_texture = nullptr;
+
+ friend class crepe::SdlContext;
};
} // namespace crepe
-