@@ -173,17 +173,27 @@ namespace rift::UI
173
173
174
174
void SetWindowIcon ()
175
175
{
176
- p::String iconPath = p::JoinPaths (p::GetBasePath (), " Resources/Editor/Icons/Icon.png" );
177
- GLFWimage image;
178
- image.pixels = stbi_load (
179
- iconPath.c_str (), &image.width , &image.height , nullptr , 0 ); // rgba channels
180
- if (image.pixels == nullptr )
176
+ p::String icon64Path = p::JoinPaths (p::GetBasePath (), " Resources/Editor/Icons/Logo_64.png" );
177
+ p::String icon128Path =
178
+ p::JoinPaths (p::GetBasePath (), " Resources/Editor/Icons/Logo_128.png" );
179
+ p::String icon256Path =
180
+ p::JoinPaths (p::GetBasePath (), " Resources/Editor/Icons/Logo_256.png" );
181
+ GLFWimage images[3 ];
182
+ images[0 ].pixels =
183
+ stbi_load (icon64Path.c_str (), &images[0 ].width , &images[0 ].height , nullptr , 0 );
184
+ images[1 ].pixels =
185
+ stbi_load (icon128Path.c_str (), &images[1 ].width , &images[1 ].height , nullptr , 0 );
186
+ images[2 ].pixels =
187
+ stbi_load (icon256Path.c_str (), &images[2 ].width , &images[2 ].height , nullptr , 0 );
188
+ if (!images[0 ].pixels || !images[1 ].pixels || !images[2 ].pixels )
181
189
{
182
190
p::Error (" Window icon couldn't be loaded" );
183
191
return ;
184
192
}
185
- glfwSetWindowIcon (gWindow , 1 , &image );
193
+ glfwSetWindowIcon (gWindow , 3 , images );
186
194
187
- stbi_image_free (image.pixels );
195
+ stbi_image_free (images[0 ].pixels );
196
+ stbi_image_free (images[1 ].pixels );
197
+ stbi_image_free (images[2 ].pixels );
188
198
}
189
199
} // namespace rift::UI
0 commit comments