COMPLETER LA CLASSE ABSTRAITE
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user