#ifndef CLOADINGWINDOW_HPP
#define CLOADINGWINDOW_HPP

#include "CWindow.hpp"
#include "../../Controller/Exception/CLibException.hpp"
#include "../../Controller/Exception/CLogicException.hpp"

#include <cstdlib>
#include <string>
#include <utility>
#include <exception>
#include <stdexcept>
#include <SDL.h>
#ifdef WIN32
    #include <SDL_Image.h>
#else
    #include <SDL_image.h>
#endif

/**
 * @file CLoadingWindow.hpp
 * @brief File of CWindow, a class reprensenting a loading Window, using SDL2 lib.
 */

/**
 * @brief Class reprensenting a loading Window, using SDL2 lib.
 */
class CLoadingWindow : public CWindow {
private:
	// The path to the splash image.
	std::string m_splashPath;

	// The pointer to the surface.
	SDL_Surface* m_psurface;

public:
	CLoadingWindow(void) = delete;
	CLoadingWindow(const CLoadingWindow& param) = delete;
	CLoadingWindow& operator=(const CLoadingWindow& param) = delete;

	/**
	 * @brief The default constructor, build a non visible window with size of widthxheight.
	 * @param[in] title The title of the window.
	 * @param[in] iconPath The iconPath of the window.
	 * @param[in] splashPath The splashPath of the window.
	 * @param[in] width The width of the window.
	 * @param[in] height The height of the window.
	 */
	CLoadingWindow(std::string title, std::string iconPath, std::string splashPath, unsigned int width, unsigned int height);

	/**
	 * @brief The destructor.
	 */
	~CLoadingWindow(void);

	/**
	 * @brief Launched before the creation of the window, usefull for setting OpenGL attribute.
	 */
	virtual void preinitialization();

	/**
	 * @brief Launched after the creation of the window, usefull for setting others attribute.
	 */
	virtual void postinitialization();
};

#endif