当前位置: 首页>>代码示例>>Java>>正文


Java Display.setResizable方法代码示例

本文整理汇总了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();
}
 
开发者ID:Vinetos,项目名称:FreeWorld,代码行数:20,代码来源:FreeWorld.java

示例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();
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:23,代码来源:Minecraft.java

示例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();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:31,代码来源:Minecraft.java

示例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;
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:42,代码来源:VideoHook.java

示例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);
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:30,代码来源:VideoHook.java

示例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();
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:31,代码来源:Minecraft.java

示例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();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:31,代码来源:Minecraft.java

示例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();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:31,代码来源:Minecraft.java

示例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);
            }
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:75,代码来源:Config.java

示例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();
                }
            }
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:48,代码来源:Config.java

示例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);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:75,代码来源:Config.java


注:本文中的org.lwjgl.opengl.Display.setResizable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。