当前位置: 首页>>代码示例>>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;未经允许,请勿转载。