本文整理匯總了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();
}
示例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());
}
示例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);
}
示例4: getCurrentVideoMode
import org.lwjgl.glfw.GLFW; //導入方法依賴的package包/類
public static GLFWVidMode getCurrentVideoMode()
{
return GLFW.glfwGetVideoMode(GLFW.glfwGetPrimaryMonitor());
}