org.lwjgl.opengl.Display.setIcon()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(307)

本文整理了Java中org.lwjgl.opengl.Display.setIcon()方法的一些代码示例,展示了Display.setIcon()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Display.setIcon()方法的具体详情如下:
包路径:org.lwjgl.opengl.Display
类名称:Display
方法名:setIcon

Display.setIcon介绍

暂无

代码示例

代码示例来源:origin: MovingBlocks/Terasology

BufferedImage icon128 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_128.png"));
Display.setIcon(new ByteBuffer[]{
    TextureUtil.convertToByteBuffer(icon16),
    TextureUtil.convertToByteBuffer(icon32),

代码示例来源:origin: libgdx/libgdx

pixmap.dispose();
Display.setIcon(icons);

代码示例来源:origin: libgdx/libgdx

pixmap.dispose();
Display.setIcon(icons);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

Display.setIcon(imagesToByteBuffers(settings.getIcons()));

代码示例来源:origin: Mojang/LegacyLauncher

public static void loadIconsOnFrames() {
  try {
    // Load icon from disk
    final File smallIcon = new File(Launch.assetsDir, "icons/icon_16x16.png");
    final File bigIcon = new File(Launch.assetsDir, "icons/icon_32x32.png");
    System.out.println("Loading current icons for window from: " + smallIcon + " and " + bigIcon);
    Display.setIcon(new ByteBuffer[]{
        loadIcon(smallIcon),
        loadIcon(bigIcon)
    });
    Frame[] frames = Frame.getFrames();
    if (frames != null) {
      final List<Image> icons = Arrays.<Image>asList(ImageIO.read(smallIcon), ImageIO.read(bigIcon));
      for (Frame frame : frames) {
        try {
          frame.setIconImages(icons);
        } catch (Throwable throwable) {
          throwable.printStackTrace();
        }
      }
    }
  } catch (IOException e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: org.slick2d/slick2d-core

/**
 * @see org.newdawn.slick.GameContainer#setIcons(java.lang.String[])
 */
public void setIcons(String[] refs) throws SlickException {
  ByteBuffer[] bufs = new ByteBuffer[refs.length];
  for (int i=0;i<refs.length;i++) {
    LoadableImageData data;
    boolean flip = true;
    
    if (refs[i].endsWith(".tga")) {
      data = new TGAImageData();
    } else {
      flip = false;
      data = new ImageIOImageData();
    }
    
    try {
      bufs[i] = data.loadImage(ResourceLoader.getResourceAsStream(refs[i]), flip, false, null);
    } catch (Exception e) {
      Log.error(e);
      throw new SlickException("Failed to set the icon");
    }
  }
  
  Display.setIcon(bufs);
}

代码示例来源:origin: com.ardor3d/ardor3d-lwjgl

public void setIcon(final Image[] iconImages) {
  final ByteBuffer[] iconData = new ByteBuffer[iconImages.length];
  for (int i = 0; i < iconData.length; i++) {
    // Image.Format.RGBA8 is the format that LWJGL requires, so try to convert if it's not.
    if (iconImages[i].getDataType() != PixelDataType.UnsignedByte) {
      throw new Ardor3dException(
          "Your icon is in a format that could not be converted to UnsignedByte - RGBA");
    }
    if (iconImages[i].getDataFormat() != ImageDataFormat.RGBA) {
      if (iconImages[i].getDataFormat() != ImageDataFormat.RGB) {
        throw new Ardor3dException(
            "Your icon is in a format that could not be converted to UnsignedByte - RGBA");
      }
      iconImages[i] = _RGB888_to_RGBA8888(iconImages[i]);
    }
    iconData[i] = iconImages[i].getData(0);
    iconData[i].rewind();
  }
  Display.setIcon(iconData);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl

pixmap.dispose();
Display.setIcon(icons);

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl

Display.setIcon(imagesToByteBuffers(settings.getIcons()));

相关文章