// Copyright (C) 2015 Jérôme Leclercq // This file is part of the "Nazara Engine - Utility module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #if defined(NAZARA_PLATFORM_WINDOWS) #include #elif defined(NAZARA_PLATFORM_X11) #include #else #error Lack of implementation: Icon #endif #include namespace Nz { Icon::Icon() : m_impl(nullptr) { } Icon::~Icon() { Destroy(); } bool Icon::Create(const Image& icon) { Destroy(); m_impl = new IconImpl; if (!m_impl->Create(icon)) { NazaraError("Failed to create icon implementation"); delete m_impl; m_impl = nullptr; return false; } return true; } void Icon::Destroy() { if (m_impl) { m_impl->Destroy(); delete m_impl; m_impl = nullptr; } } bool Icon::IsValid() const { return m_impl != nullptr; } }