當前位置: 首頁>>代碼示例>>Java>>正文


Java GLFW.glfwGetVideoMode方法代碼示例

本文整理匯總了Java中org.lwjgl.glfw.GLFW.glfwGetVideoMode方法的典型用法代碼示例。如果您正苦於以下問題:Java GLFW.glfwGetVideoMode方法的具體用法?Java GLFW.glfwGetVideoMode怎麽用?Java GLFW.glfwGetVideoMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.lwjgl.glfw.GLFW的用法示例。


在下文中一共展示了GLFW.glfwGetVideoMode方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createBackground

import org.lwjgl.glfw.GLFW; //導入方法依賴的package包/類
private void createBackground() {
	Variables.X = 0;
	Variables.Y = 0;
	GLFWVidMode vidmode = GLFW.glfwGetVideoMode(GLFW.glfwGetPrimaryMonitor());
	WindowHandle handle = WindowManager.generateHandle(vidmode.width(), vidmode.height(), "");
	handle.isDecorated(false);
	handle.isVisible(false);
	PixelBufferHandle pb = new PixelBufferHandle();
	pb.setSrgbCapable(1);
	pb.setSamples(4);
	handle.setPixelBuffer(pb);
	Window backWindow = WindowManager.generate(handle);

	Thread backThr = new Thread(() -> {
		backgroundWindow = new Background(backWindow, handle);
		backgroundWindow.init();
		float delta = 0;
		float accumulator = 0f;
		float interval = 1f / 5;
		float alpha = 0;
		int fps = 5;
		Window window = backgroundWindow.getWindow();
		while (running) {
			delta = window.getDelta();
			accumulator += delta;
			while (accumulator >= interval) {
				backgroundWindow.update(interval);
				accumulator -= interval;
			}
			alpha = accumulator / interval;
			if (window.isVisible())
				backgroundWindow.render(alpha);
			window.updateDisplay(fps);
		}
		backgroundWindow.dispose();
		window.dispose();
	});
	backThr.start();
}
 
開發者ID:Guerra24,項目名稱:NanoUI,代碼行數:40,代碼來源:TaskBar.java

示例2: main

import org.lwjgl.glfw.GLFW; //導入方法依賴的package包/類
public static void main(String[] args) {
	new Bootstrap(args);
	GLFWVidMode vidmode = GLFW.glfwGetVideoMode(GLFW.glfwGetPrimaryMonitor());
	Variables.WIDTH = vidmode.width();
	Variables.HEIGHT = 40;
	Variables.X = 0;
	Variables.Y = vidmode.height() - 40;
	Variables.ALWAYS_ON_TOP = true;
	Variables.DECORATED = false;
	Variables.TITLE = "Shell_TrayWnd";
	new App(new TaskBar());
}
 
開發者ID:Guerra24,項目名稱:NanoUI,代碼行數:13,代碼來源:TaskBar.java

示例3: center

import org.lwjgl.glfw.GLFW; //導入方法依賴的package包/類
public void center(){
	GLFWVidMode mon = GLFW.glfwGetVideoMode(GLFW.glfwGetPrimaryMonitor());
	setPosition((mon.width() - width) / 2, (mon.height() - height) / 2);
}
 
開發者ID:tek256,項目名稱:LD38,代碼行數:5,代碼來源:Window.java

示例4: getCurrentVideoMode

import org.lwjgl.glfw.GLFW; //導入方法依賴的package包/類
public static GLFWVidMode getCurrentVideoMode()
{
	return GLFW.glfwGetVideoMode(GLFW.glfwGetPrimaryMonitor());
}
 
開發者ID:andykuo1,項目名稱:candlelight,代碼行數:5,代碼來源:Window.java


注:本文中的org.lwjgl.glfw.GLFW.glfwGetVideoMode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。