本文整理匯總了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();
}
}
示例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();
}
}
示例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();
}
示例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();
}
}