【发布时间】:2019-12-06 06:49:49
【问题描述】:
调整大小后,我在下一行的窗口中快速移动。它只设置一次窗口大小。它不需要由用户拖动。它会在添加到窗口的部分上闪烁,并且在某些情况下,整个窗口会闪烁某种内容的反转图像。它在 Windows 7 上测试并使用 Java。调整大小的时间有什么可做的吗?它使用在程序打开时开始运行的锁定帧速率。
while (!glfwWindowShouldClose(window)) {
render(window, buffer.get(1), framebuffer);
lasttime = time;
Thread.sleep(max(0, 1000/60 - ((long) glfwGetTime() - lasttime)*1000));
time = time + 1/60;
}
public static void render(long win, int rb, int fb) {
glfwSetWindowSize(
win, 320, windowheight
);
glBindFramebuffer(GL_READ_BUFFER, fb);
glBindFramebuffer(GL_DRAW_BUFFER, 0);
glReadBuffer(GL_COLOR_ATTACHMENT0);
glDrawBuffer(GL_BACK_LEFT);
glBlitFramebuffer(0,0,319,windowheight-1,0,0,319,windowheight-1,GL_COLOR_BUFFER_BIT,GL_NEAREST);
}
【问题讨论】: