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


Java Display.setInitialBackground方法代码示例

本文整理汇总了Java中org.lwjgl.opengl.Display.setInitialBackground方法的典型用法代码示例。如果您正苦于以下问题:Java Display.setInitialBackground方法的具体用法?Java Display.setInitialBackground怎么用?Java Display.setInitialBackground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.opengl.Display的用法示例。


在下文中一共展示了Display.setInitialBackground方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
	}
}
 
开发者ID:TheThinMatrix,项目名称:LowPolyWater,代码行数:20,代码来源:Window.java

示例2: main

import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public static void main(String[] args) {
    AppGameContainer gameContainer;
    try {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        width = (int)screenSize.getWidth();
        height = (int)screenSize.getHeight();
        gameContainer = new AppGameContainer(new Play(gamename));
        gameContainer.setVSync(true); // Should probably stay true for performance
        gameContainer.setDisplayMode(width, height, true);
        gameContainer.setTargetFrameRate(fps);
        gameContainer.setShowFPS(showFps);
        Display.setInitialBackground(1, 1, 1);
        gameContainer.start();
    } catch(SlickException e) {
        e.printStackTrace();
    }
}
 
开发者ID:nitrodragon,项目名称:ThunderingSky,代码行数:18,代码来源:Play.java

示例3: createDisplay

import org.lwjgl.opengl.Display; //导入方法依赖的package包/类
public static void createDisplay() {
	try {
		Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
		ContextAttribs attribs = new ContextAttribs(3, 2).withProfileCore(true).withForwardCompatible(true);
		Display.create(new PixelFormat().withDepthBits(24).withSamples(4), attribs);
		Display.setTitle(TITLE);
		Display.setInitialBackground(1, 1, 1);
		GL11.glEnable(GL13.GL_MULTISAMPLE);
	} catch (LWJGLException e) {
		e.printStackTrace();
		System.err.println("Couldn't create display!");
		System.exit(-1);
	}
	GL11.glViewport(0, 0, WIDTH, HEIGHT);
	lastFrameTime = getCurrentTime();
}
 
开发者ID:TheThinMatrix,项目名称:OpenGL-Animation,代码行数:17,代码来源:DisplayManager.java

示例4: 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();
    }
}
 
开发者ID:GryPLOfficial,项目名称:EcoSystem-Official,代码行数:20,代码来源:Window.java


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