updated icon loading

pull/7/head
hYdos 2020-02-25 07:34:33 +10:00
parent ffef70e1fc
commit 377534a4ce
3 changed files with 3 additions and 3 deletions

View File

@ -76,7 +76,8 @@ public class Litecraft extends Game{
for(BlockEntity b: chunk) {
data.entities.add(b);
}
Window.setIcon("/textures/grass.png");
FontType font = new FontType(Loader.loadFontAtlas("candara.png"), "candara.fnt");

View File

@ -180,6 +180,7 @@ public class Window {
iconBuffer = GLFWImage.malloc(1);
iconImage.set(icon.getWidth(), icon.getHeight(), icon.getImage());
iconBuffer.put(0, iconImage);
GLFW.glfwSetWindowIcon(window, iconBuffer);
}
public static void showIcon() {

View File

@ -58,8 +58,6 @@ public class Image {
IntBuffer h = stack.mallocInt(1);
IntBuffer comp = stack.mallocInt(1);
// Use info to read image metadata without decoding the entire image.
// We don't need this for this demo, just testing the API.
if (!stbi_info_from_memory(imageBuffer, w, h, comp)) {
throw new RuntimeException("Failed to read image information: " + stbi_failure_reason());
}