简体   繁体   English

为什么我无法调整 GLWindow 的大小(甚至不显示调整大小的光标)?

[英]Why am I unable to resize my GLWindow (resizing cursor doesn't even show up)?

I'm trying to learn OpenGL off a tutorial that uses JOGL to make a 2D game.我正在尝试从使用 JOGL 制作 2D 游戏的教程中学习 OpenGL。 My code is pretty much identical aside from a few name changes and better formatting but for some reason, unlike the person's from the tutorial, my window is not resizable.除了一些名称更改和更好的格式之外,我的代码几乎相同,但出于某种原因,与教程中的人不同,我的窗口不可调整大小。

// Main window class
public class Display
{
    private static GLWindow window = null;
    private static FPSAnimator fps;

    public Display()
    {
        GLProfile.initSingleton();
        GLProfile glp = GLProfile.get(GLProfile.GL2);
        GLCapabilities glc = new GLCapabilities(glp);
        window = GLWindow.create(glc);
        window.setSize(640, 320);
        window.setResizable(true);
        window.addGLEventListener(new GraphicListener());
        fps = new FPSAnimator(window, 60);
        fps.start();
        window.setVisible(true);
    }
}

It'll maximise and shrink just fine and I can drag it around, but even though I set it to be resizable, it's just not.它会最大化和收缩得很好,我可以拖动它,但即使我将它设置为可调整大小,它也不是。 The little resizing arrows that appear when touching the sides of any other window never even show up.触摸任何其他窗口的侧面时出现的调整大小的小箭头甚至从未出现过。

It should be resizable even though the resizing arrows don't show up.即使没有显示调整大小的箭头,它也应该可以调整大小。 You just have to click very close to the edge.您只需在非常靠近边缘的地方单击即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM