本文整理匯總了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);
}
}
}
}