GLJPanel 停止重绘
我正在使用 Jogl 在 Netbeans 平台模块项目中创建 GLJPanel(这是一种非常特定类型的 Java 应用程序,它在 Netbeans 平台应用程序中创建模块化窗口,因此您可以拖动多个窗口)。
我无法使用 GLCanvas,因为它无法在 Windows 或 Linux 上运行(Netbeans 和 Jogl 几乎是天造地设的一对)。我无法使用 NEWT,因为它在 Mac 上不起作用。所以我使用 GLJPanel,尽管它很慢。
无论如何,一开始它通常会起作用。然后,如果我调整大小或在程序中执行其他操作,窗口似乎会失去焦点并且永远不会重新获得焦点。窗口不会重绘。我仍然收到鼠标事件(但没有按键事件!)。我知道这一点是因为我可以单击另一个窗口,它会重绘 GLJPanel 一次。否则屏幕不会重绘。
我已经尝试了将 sun.java2d.opengl 和 sun.java2d.noddraw 设置为 true 和 false 的所有组合,按照 http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/opengl/awt/GLCanvas.html#java2dgl
这是开源的一部分项目,所以我的组件的源位于
我明显在做什么吗错误的?
I am using Jogl to create a GLJPanel inside a Netbeans Platform module project (this is a very specific type of Java application that creates a modular window within a netbeans platform app, so there are multiple windows you can drag around).
I can't use GLCanvas because it doesn't work on Windows or Linux (Netbeans and Jogl is pretty much a match made in hell). I can't use NEWT because that doesn't work on the Mac. So I'm using a GLJPanel, even though it is slow.
Anyway, it usually works at first. Then, if I resize or do something else in the program, the window seems to lose focus and never regain it. The window won't redraw. I still get mouse events (no key events, though!). I know this because I can click on another window and it will redraw the GLJPanel once. Otherwise the screen doesn't redraw.
I have tried all combinations of setting sun.java2d.opengl and sun.java2d.noddraw to true and false, as per http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/opengl/awt/GLCanvas.html#java2dgl
This is part of an open source project, so the source of my component is at
Am I doing anything obviously wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不会将这些标志设置为 true,因为 gui 元素存在一些错误。我在没有将这些标志设置为 true 的情况下编写了我的程序。如果您让它工作,我会建议覆盖 GLPanel 或 GLCanvas 的 GLEventListener。应该重新绘制不断等待您的回复,也许如果您提供更多详细信息,我可以帮助您。
I wouldn't set those flags to true because had some bugs with gui elements.I have coded my program without these flags set to true.I would recomand to override the GLEventListener of the GLPanel or GLCanvas if you got it to work.Should repaint continuously.Waiting you're response maybe if you give more details i can help you.