This commit is contained in:
parent
b9a26ab61e
commit
9b6b60e4d1
@ -26,7 +26,7 @@ void removeDrawer(Context &ctx, Drawer *cd) noexcept;
|
||||
|
||||
ox::Error initGfx(Context &ctx) noexcept;
|
||||
|
||||
ox::Error setWindowIcon(Context &ctx, ox::SpanView<uint8_t> iconPng) noexcept;
|
||||
ox::Error setWindowIcon(Context &ctx, ox::SpanView<uint8_t> const &iconPng) noexcept;
|
||||
|
||||
void setWindowTitle(Context &ctx, ox::StringViewCR title) noexcept;
|
||||
|
||||
|
@ -235,7 +235,7 @@ struct IconData {
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
static ox::Result<IconData> toGlfwImgPixels(ox::SpanView<uint8_t> iconPng) noexcept {
|
||||
static ox::Result<IconData> toGlfwImgPixels(ox::SpanView<uint8_t> const &iconPng) noexcept {
|
||||
ox::Result<IconData> out;
|
||||
unsigned w{}, h{};
|
||||
if (lodepng::decode(out.value.pixels, w, h, iconPng.data(), LodePNGColorType::LCT_RGBA)) {
|
||||
@ -246,7 +246,7 @@ static ox::Result<IconData> toGlfwImgPixels(ox::SpanView<uint8_t> iconPng) noexc
|
||||
return out;
|
||||
}
|
||||
|
||||
ox::Error setWindowIcon(Context &ctx, ox::SpanView<uint8_t> iconPng) noexcept {
|
||||
ox::Error setWindowIcon(Context &ctx, ox::SpanView<uint8_t> const &iconPng) noexcept {
|
||||
OX_REQUIRE_M(icon, toGlfwImgPixels(iconPng));
|
||||
GLFWimage const img {
|
||||
.width = icon.w,
|
||||
|
Loading…
x
Reference in New Issue
Block a user