本文整理汇总了Java中org.lwjgl.opengl.Display.setIcon方法的典型用法代码示例。如果您正苦于以下问题:Java Display.setIcon方法的具体用法?Java Display.setIcon怎么用?Java Display.setIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.Display
的用法示例。
在下文中一共展示了Display.setIcon方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Window
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
protected Window(Context context, WindowBuilder settings) {
this.fpsCap = settings.getFpsCap();
try {
getSuitableFullScreenModes();
DisplayMode resolution = getStartResolution(settings);
Display.setInitialBackground(1, 1, 1);
this.aspectRatio = (float) resolution.getWidth() / resolution.getHeight();
setResolution(resolution, settings.isFullScreen());
if (settings.hasIcon()) {
Display.setIcon(settings.getIcon());
}
Display.setVSyncEnabled(settings.isvSync());
Display.setTitle(settings.getTitle());
Display.create(new PixelFormat().withDepthBits(24).withSamples(4), context.getAttribs());
GL11.glViewport(0, 0, resolution.getWidth(), resolution.getHeight());
} catch (LWJGLException e) {
e.printStackTrace();
}
}
示例2: setWindowIcon
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
private void setWindowIcon() {
Util.EnumOS util$enumos = Util.getOSType();
if (util$enumos != Util.EnumOS.OSX) {
InputStream inputstream = null;
InputStream inputstream1 = null;
try {
inputstream = this.mcDefaultResourcePack
.getInputStreamAssets(new ResourceLocation("icons/icon_16x16.png"));
inputstream1 = this.mcDefaultResourcePack
.getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png"));
if (inputstream != null && inputstream1 != null) {
Display.setIcon(new ByteBuffer[] { this.readImageToBuffer(inputstream),
this.readImageToBuffer(inputstream1) });
}
} catch (IOException ioexception) {
logger.error((String) "Couldn\'t set icon", (Throwable) ioexception);
} finally {
IOUtils.closeQuietly(inputstream);
IOUtils.closeQuietly(inputstream1);
}
}
}
示例3: Window
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
protected Window(Context context, WindowBuilder settings) {
this.fpsCap = settings.getFpsCap();
try {
getSuitableFullScreenModes();
DisplayMode resolution = getStartResolution(settings);
Display.setInitialBackground(0f, 0f, 0f);
this.aspectRatio = (float) resolution.getWidth() / resolution.getHeight();
setResolution(resolution, settings.isFullScreen());
if (settings.hasIcon()) {
Display.setIcon(settings.getIcon());
}
Display.setVSyncEnabled(settings.isvSync());
Display.setTitle(settings.getTitle());
Display.create(new PixelFormat().withDepthBits(24).withSamples(4), context.getAttribs());
GL11.glViewport(0, 0, resolution.getWidth(), resolution.getHeight());
} catch (LWJGLException e) {
e.printStackTrace();
}
}
示例4: setWindowIcon
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
private void setWindowIcon()
{
Util.EnumOS util$enumos = Util.getOSType();
if (util$enumos != Util.EnumOS.OSX)
{
InputStream inputstream = null;
InputStream inputstream1 = null;
try
{
inputstream = this.mcDefaultResourcePack.getInputStreamAssets(new ResourceLocation("icons/icon_16x16.png"));
inputstream1 = this.mcDefaultResourcePack.getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png"));
if (inputstream != null && inputstream1 != null)
{
Display.setIcon(new ByteBuffer[] {this.readImageToBuffer(inputstream), this.readImageToBuffer(inputstream1)});
}
}
catch (IOException ioexception)
{
logger.error((String)"Couldn\'t set icon", (Throwable)ioexception);
}
finally
{
IOUtils.closeQuietly(inputstream);
IOUtils.closeQuietly(inputstream1);
}
}
}
示例5: setWindowIcon
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
private void setWindowIcon()
{
Util.EnumOS util$enumos = Util.getOSType();
if (util$enumos != Util.EnumOS.OSX)
{
InputStream inputstream = null;
InputStream inputstream1 = null;
try
{
inputstream = this.mcDefaultResourcePack.getInputStreamAssets(new ResourceLocation("icons/icon_16x16.png"));
inputstream1 = this.mcDefaultResourcePack.getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png"));
if (inputstream != null && inputstream1 != null)
{
Display.setIcon(new ByteBuffer[] {this.readImageToBuffer(inputstream), this.readImageToBuffer(inputstream1)});
}
}
catch (IOException ioexception)
{
LOGGER.error((String)"Couldn\'t set icon", (Throwable)ioexception);
}
finally
{
IOUtils.closeQuietly(inputstream);
IOUtils.closeQuietly(inputstream1);
}
}
}
示例6: checkDisplaySettings
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public static void checkDisplaySettings()
{
int i = getAntialiasingLevel();
if (i > 0)
{
DisplayMode displaymode = Display.getDisplayMode();
dbg("FSAA Samples: " + i);
try
{
Display.destroy();
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24).withSamples(i));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception2)
{
warn("Error setting FSAA: " + i + "x");
lwjglexception2.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception1)
{
lwjglexception1.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create();
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception)
{
lwjglexception.printStackTrace();
}
}
}
if (!Minecraft.isRunningOnMac && getDefaultResourcePack() != null)
{
InputStream inputstream = null;
InputStream inputstream1 = null;
try
{
inputstream = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_16x16.png"));
inputstream1 = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png"));
if (inputstream != null && inputstream1 != null)
{
Display.setIcon(new ByteBuffer[] {readIconImage(inputstream), readIconImage(inputstream1)});
}
}
catch (IOException ioexception)
{
warn("Error setting window icon: " + ioexception.getClass().getName() + ": " + ioexception.getMessage());
}
finally
{
IOUtils.closeQuietly(inputstream);
IOUtils.closeQuietly(inputstream1);
}
}
}
}
示例7: checkDisplaySettings
import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public static void checkDisplaySettings()
{
int i = getAntialiasingLevel();
if (i > 0)
{
DisplayMode displaymode = Display.getDisplayMode();
dbg("FSAA Samples: " + i);
try
{
Display.destroy();
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24).withSamples(i));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception2)
{
warn("Error setting FSAA: " + i + "x");
lwjglexception2.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception1)
{
lwjglexception1.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create();
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception)
{
lwjglexception.printStackTrace();
}
}
}
if (!Minecraft.IS_RUNNING_ON_MAC && getDefaultResourcePack() != null)
{
InputStream inputstream = null;
InputStream inputstream1 = null;
try
{
inputstream = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_16x16.png"));
inputstream1 = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png"));
if (inputstream != null && inputstream1 != null)
{
Display.setIcon(new ByteBuffer[] {readIconImage(inputstream), readIconImage(inputstream1)});
}
}
catch (IOException ioexception)
{
warn("Error setting window icon: " + ioexception.getClass().getName() + ": " + ioexception.getMessage());
}
finally
{
IOUtils.closeQuietly(inputstream);
IOUtils.closeQuietly(inputstream1);
}
}
}
}