Spectre/Display/Display: implement setIcon() with pixel array parameter.
This commit is contained in:
parent
2be3c66a2d
commit
82add50157
2 changed files with 14 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include <iostream>
|
||||
#include <Spectre/Display/Display.h>
|
||||
#include <Spectre/Display/GLContext.h>
|
||||
#include <Spectre/Graphics/Image.h>
|
||||
#include <Platform/PlatformDisplay.h>
|
||||
|
||||
namespace sp {
|
||||
|
|
@ -75,7 +76,16 @@ const std::string& Display::getCaption() const
|
|||
|
||||
void Display::setIcon(const std::string& filename)
|
||||
{
|
||||
m_impl->setIcon(filename);
|
||||
Image img;
|
||||
|
||||
if (img.loadFromFile(filename)) {
|
||||
setIcon(img.getWidth(), img.getHeight(), img.getPixels());
|
||||
}
|
||||
}
|
||||
|
||||
void Display::setIcon(unsigned int width, unsigned int height, const uint8_t *pixels)
|
||||
{
|
||||
m_impl->setIcon(width, height, pixels);
|
||||
}
|
||||
|
||||
void Display::setSize(unsigned int width, unsigned int height)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue