本文整理匯總了Java中org.lwjgl.opengl.Display.setResizable方法的典型用法代碼示例。如果您正苦於以下問題:Java Display.setResizable方法的具體用法?Java Display.setResizable怎麽用?Java Display.setResizable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.opengl.Display
的用法示例。
在下文中一共展示了Display.setResizable方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
public static void main(String... args){
System.setProperty("org.lwjgl.librarypath", new File("native/"+(System.getProperties().getProperty("os.name").split(" ")[0]).toLowerCase()).getAbsolutePath());
FreeWorld.getFreeWorld();
try {
Display.setTitle(FreeWorld.getFreeWorld().getTitle());
Display.setDisplayMode(new DisplayMode(720, 480));
Display.setResizable(true);
Display.create();
}catch (LWJGLException e){
e.printStackTrace();
}
//TODO: Provisoire
glClearColor(0.2f, 0.7f, 0.7f, 1.0f);
FreeWorld.getFreeWorld().start();
}
示例2: createDisplay
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
private void createDisplay() throws LWJGLException {
Display.setResizable(true);
Display.setTitle("Minecraft 1.8.8");
try {
Display.create((new PixelFormat()).withDepthBits(24));
} catch (LWJGLException lwjglexception) {
logger.error((String) "Couldn\'t set pixel format", (Throwable) lwjglexception);
try {
Thread.sleep(1000L);
} catch (InterruptedException var3) {
;
}
if (this.fullscreen) {
this.updateDisplayMode();
}
Display.create();
}
}
示例3: createDisplay
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
private void createDisplay() throws LWJGLException
{
Display.setResizable(true);
Display.setTitle("Minecraft 1.8.8");
try
{
Display.create((new PixelFormat()).withDepthBits(24));
}
catch (LWJGLException lwjglexception)
{
logger.error((String)"Couldn\'t set pixel format", (Throwable)lwjglexception);
try
{
Thread.sleep(1000L);
}
catch (InterruptedException var3)
{
;
}
if (this.fullscreen)
{
this.updateDisplayMode();
}
Display.create();
}
}
示例4: start
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
/**
* Resize the rendering and start sending video over TCP.
*/
public void start(MissionInit missionInit, IVideoProducer videoProducer)
{
if (videoProducer == null)
{
return; // Don't start up if there is nothing to provide the video.
}
videoProducer.prepare(missionInit);
this.missionInit = missionInit;
this.videoProducer = videoProducer;
this.buffer = BufferUtils.createByteBuffer(this.videoProducer.getRequiredBufferSize());
this.headerbuffer = ByteBuffer.allocate(20).order(ByteOrder.BIG_ENDIAN);
this.renderWidth = videoProducer.getWidth(missionInit);
this.renderHeight = videoProducer.getHeight(missionInit);
resizeIfNeeded();
Display.setResizable(false); // prevent the user from resizing using the window borders
ClientAgentConnection cac = missionInit.getClientAgentConnection();
if (cac == null)
return; // Don't start up if we don't have any connection details.
String agentIPAddress = cac.getAgentIPAddress();
int agentPort = cac.getAgentVideoPort();
this.connection = new TCPSocketHelper.SocketChannelHelper(agentIPAddress, agentPort);
this.failedTCPSendCount = 0;
try
{
MinecraftForge.EVENT_BUS.register(this);
FMLCommonHandler.instance().bus().register(this);
}
catch(Exception e)
{
System.out.println("Failed to register video hook: " + e);
}
this.isRunning = true;
}
示例5: stop
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
/**
* Stop sending video.
*/
public void stop()
{
if( !this.isRunning )
{
return;
}
if (this.videoProducer != null)
this.videoProducer.cleanup();
// stop sending video frames
try
{
MinecraftForge.EVENT_BUS.unregister(this);
FMLCommonHandler.instance().bus().unregister(this);
}
catch(Exception e)
{
System.out.println("Failed to unregister video hook: " + e);
}
// Close our TCP socket:
this.connection.close();
this.isRunning = false;
// allow the user to resize the window again
Display.setResizable(true);
}
示例6: createDisplay
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
private void createDisplay() throws LWJGLException
{
Display.setResizable(true);
Display.setTitle("Minecraft 1.11");
try
{
Display.create((new PixelFormat()).withDepthBits(24));
}
catch (LWJGLException lwjglexception)
{
LOGGER.error((String)"Couldn\'t set pixel format", (Throwable)lwjglexception);
try
{
Thread.sleep(1000L);
}
catch (InterruptedException var3)
{
;
}
if (this.fullscreen)
{
this.updateDisplayMode();
}
Display.create();
}
}
示例7: createDisplay
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
private void createDisplay() throws LWJGLException
{
Display.setResizable(true);
Display.setTitle(Client.CLIENT_NAME + " v" + Client.CLIENT_VERSION);
try
{
Display.create((new PixelFormat()).withDepthBits(24));
}
catch (LWJGLException lwjglexception)
{
LOGGER.error((String)"Couldn\'t set pixel format", (Throwable)lwjglexception);
try
{
Thread.sleep(1000L);
}
catch (InterruptedException var3)
{
;
}
if (this.fullscreen)
{
this.updateDisplayMode();
}
Display.create();
}
}
示例8: createDisplay
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
private void createDisplay() throws LWJGLException
{
Display.setResizable(true);
Display.setTitle("Minecraft 1.10.2");
try
{
Display.create((new PixelFormat()).withDepthBits(24));
}
catch (LWJGLException lwjglexception)
{
LOGGER.error((String)"Couldn\'t set pixel format", (Throwable)lwjglexception);
try
{
Thread.sleep(1000L);
}
catch (InterruptedException var3)
{
;
}
if (this.fullscreen)
{
this.updateDisplayMode();
}
Display.create();
}
}
示例9: 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);
}
}
}
}
示例10: checkDisplaySettings
import org.lwjgl.opengl.Display; //導入方法依賴的package包/類
public static void checkDisplaySettings()
{
if (getAntialiasingLevel() > 0)
{
int i = getAntialiasingLevel();
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();
}
}
}
}
}
示例11: 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);
}
}
}
}