COMPLETER LA CLASSE ABSTRAITE

This commit is contained in:
YANNIS
2025-06-01 10:34:29 +02:00
parent 90c5485fc5
commit cfee2379ab
6 changed files with 29 additions and 4 deletions
+15 -3
View File
@@ -1,12 +1,24 @@
#include "Sprite.hpp"
Sol::Sol() {
Sol::Sol(SDL_Renderer* renderer) : Sprite() {
// Constructor implementation
std::cout << "Sol created." << std::endl;
if (renderer == nullptr)
throw std::runtime_error("Renderer is null");
surface = IMG_Load("map/SOL.png");
texture = SDL_CreateTextureFromSurface(renderer, surface);
SDL_FreeSurface(surface);
std::cout << "Sol created." << std::endl;
}
Sol::~Sol() {
// Destructor implementation
SDL_DestroyTexture(texture);
texture = nullptr;
surface = nullptr;
std::cout << "Sol destroyed." << std::endl;
}
void Sol::draw() {
// Drawing implementation
}