當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。