25 lines
583 B
C++
25 lines
583 B
C++
#include "Sprite.hpp"
|
|
|
|
Sol::Sol(SDL_Renderer* renderer) : Sprite() {
|
|
// Constructor implementation
|
|
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
|
|
|
|
}
|