Files
NazaraEngine/src/Nazara/Utility/Icon.cpp
Lynix c096756dab Happy thousandth commit Nazara
Updated copyright year (Yay, 515 file updated)
Regenerated global headers
Fixed some typo
Improved some shaders
-Blah blah blah-

Thank you all for supporting my project !
-Lynix


Former-commit-id: e4e741b318ba4f203da5ffd265bd5e516e7ffd7d
2014-01-12 20:16:21 +01:00

59 lines
954 B
C++

// Copyright (C) 2014 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 <Nazara/Utility/Icon.hpp>
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Utility/Win32/IconImpl.hpp>
#elif defined(NAZARA_PLATFORM_LINUX)
#include <Nazara/Utility/Linux/IconImpl.hpp>
#else
#error Lack of implementation: Icon
#endif
#include <Nazara/Utility/Debug.hpp>
NzIcon::NzIcon() :
m_impl(nullptr)
{
}
NzIcon::~NzIcon()
{
Destroy();
}
bool NzIcon::Create(const NzImage& icon)
{
Destroy();
m_impl = new NzIconImpl;
if (!m_impl->Create(icon))
{
NazaraError("Failed to create icon implementation");
delete m_impl;
m_impl = nullptr;
return false;
}
return true;
}
void NzIcon::Destroy()
{
if (m_impl)
{
m_impl->Destroy();
delete m_impl;
m_impl = nullptr;
}
}
bool NzIcon::IsValid() const
{
return m_impl != nullptr;
}