aboutsummaryrefslogtreecommitdiff
path: root/resource-manager/main.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-09-25 16:38:14 +0200
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-09-25 16:38:14 +0200
commita6f3b8c71513a1a7d416ec57627836ed4d9a7d94 (patch)
tree858d699b45b18baf8493b89ebac1ee6f5cfd3b4c /resource-manager/main.cpp
parent9ab843567b27bd23eb7e0d2d4a48b78f7df93595 (diff)
fully working map,textures and spritesheets togheter
Diffstat (limited to 'resource-manager/main.cpp')
-rw-r--r--resource-manager/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/resource-manager/main.cpp b/resource-manager/main.cpp
index d0e8312..a301114 100644
--- a/resource-manager/main.cpp
+++ b/resource-manager/main.cpp
@@ -31,13 +31,11 @@ int main() {
ResourceManager * rm = new ResourceManager();
- /*
Texture* img = rm->Load<Texture>("../img.png");
img->setTexture(*renderer);
SpriteSheet* SS = rm->Load<SpriteSheet>("../spritesheet_test.png");
SS->set_spritesheet_data(*renderer, 1, 4);
- */
Map* map = rm->Load<Map>("../../asset/tiled/demo.tmx");
map->SetRenderer(*renderer);
@@ -61,6 +59,11 @@ int main() {
SDL_RenderClear(renderer);
+ SDL_RenderCopy(renderer, img->getTexture(), NULL, NULL);
+ SS->select_sprite(sprite, 0);
+ SDL_Rect pos = {10,10,32,64};
+ SS->draw_selected_sprite(renderer, &pos);
+ map->draw();
SDL_RenderPresent(renderer);
}
delete rm;