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