updated icon loading
parent
ffef70e1fc
commit
377534a4ce
|
@ -76,7 +76,8 @@ public class Litecraft extends Game{
|
||||||
for(BlockEntity b: chunk) {
|
for(BlockEntity b: chunk) {
|
||||||
data.entities.add(b);
|
data.entities.add(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Window.setIcon("/textures/grass.png");
|
||||||
|
|
||||||
|
|
||||||
FontType font = new FontType(Loader.loadFontAtlas("candara.png"), "candara.fnt");
|
FontType font = new FontType(Loader.loadFontAtlas("candara.png"), "candara.fnt");
|
||||||
|
|
|
@ -180,6 +180,7 @@ public class Window {
|
||||||
iconBuffer = GLFWImage.malloc(1);
|
iconBuffer = GLFWImage.malloc(1);
|
||||||
iconImage.set(icon.getWidth(), icon.getHeight(), icon.getImage());
|
iconImage.set(icon.getWidth(), icon.getHeight(), icon.getImage());
|
||||||
iconBuffer.put(0, iconImage);
|
iconBuffer.put(0, iconImage);
|
||||||
|
GLFW.glfwSetWindowIcon(window, iconBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showIcon() {
|
public static void showIcon() {
|
||||||
|
|
|
@ -58,8 +58,6 @@ public class Image {
|
||||||
IntBuffer h = stack.mallocInt(1);
|
IntBuffer h = stack.mallocInt(1);
|
||||||
IntBuffer comp = 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)) {
|
if (!stbi_info_from_memory(imageBuffer, w, h, comp)) {
|
||||||
throw new RuntimeException("Failed to read image information: " + stbi_failure_reason());
|
throw new RuntimeException("Failed to read image information: " + stbi_failure_reason());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue