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 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;
|
void setWindowTitle(Context &ctx, ox::StringViewCR title) noexcept;
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ struct IconData {
|
|||||||
};
|
};
|
||||||
|
|
||||||
[[nodiscard]]
|
[[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;
|
ox::Result<IconData> out;
|
||||||
unsigned w{}, h{};
|
unsigned w{}, h{};
|
||||||
if (lodepng::decode(out.value.pixels, w, h, iconPng.data(), LodePNGColorType::LCT_RGBA)) {
|
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;
|
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));
|
OX_REQUIRE_M(icon, toGlfwImgPixels(iconPng));
|
||||||
GLFWimage const img {
|
GLFWimage const img {
|
||||||
.width = icon.w,
|
.width = icon.w,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user