updated icon loading
parent
ffef70e1fc
commit
377534a4ce
|
@ -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");
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue