为什么eclipse不会在“快速修复”中显示lwjgl导入菜单? [英] Why won't eclipse show lwjgl imports in the "quick fix" menu?

查看:168
本文介绍了为什么eclipse不会在“快速修复”中显示lwjgl导入菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了所有提到的内容在这个问题没有成功。

我也尝试删除整个工作区,让eclipse生成一个新的,并设置访问限制。

I have also tried deleting the entire workspace and letting eclipse generate a new one, and setting access restrictions.

手动删除我的eclipse安装并删除我的用户文件夹(Windows 10)中的eclipse文件夹,然后重新安装eclipse的新下载不起作用。

Deleting my installation of eclipse manually and deleting the eclipse folder in my user folder (windows 10), then reinstalling a fresh download of eclipse didn't work.

eclipse会清理导入就好了。我可以导入一些通用的东西,就像整个类,eclipse将通过快捷方式或当我保存并退出时进行更具体的导入。

eclipse will clean imports just fine. i could import something general, like an entire class, and eclipse will make more specific imports by shortcut or when i save and quit.

问题是快速修复鼠标悬停上的菜单,不提供任何导入建议。 (它将为java类,如从java.util中随机的)

The problem is the quick fix menu on mouseover, which does not offer any import suggestions. (it will for java classes such as random from java.util though)

推荐答案

我认为问题是你对LWJGL的错觉库或Java本身。
除了C ++之外,在Java函数和变量中都有一个属于类的范围。这也包括来自OpenGL / LWJGL的静态函数。由于这个限制,LWJGL实现了基于版本的。这意味着所有静态变量和方法都包含在代表实现功能的版本号的类中。

I think the problem is your missconception of the LWJGL library, or Java itself. Other than C++, in Java functions and variables HAVE to be in the scope of a class. This also includes static functions from OpenGL/LWJGL. Due to that restriction, LWJGL was implemented version-based. That means, all static variables and methods are contained in classes representing the version number the feature was implemented.

例如:glGetVertexArrays是在OpenGL 3.0中引入的,这意味着您可以在GL30课程中找到它。

For example: glGetVertexArrays was introduced in OpenGL 3.0, which means, that you can find it in the GL30 class.

优点是可以通过导入某些类来创建向后兼容的软件。例如如果要使OpenGL 3.3兼容,只需不要导入GL33以上的任何内容。缺点是你必须记住所有的版本号和功能,或者你可以在Khronos规范中查找,或者只是猜测。

The advantage is, that it is possible to create backwards compatible software by only importing certain classes. e.g. if you want to make something OpenGL 3.3 compatible, you just don't import anything above GL33. The disadvantage is, that you have to either remember all the version numbers and their features, or you look it up in the Khronos Specification, or just guess.

要使用LWJGL函数,您可以:

To use LWJGL functions, you can either:


  • 使用例如静态导入类import static org.lwjgl.opengl.GL30。*;

  • Import the class statically using e.g. import static org.lwjgl.opengl.GL30.*;

使用类名例如int vao = GL30.glGenVertexArrays();

Use the classname e.g. int vao = GL30.glGenVertexArrays();

请注意,按[Ctrl] + [Shift] + O all以*结尾的静态导入被解析为个人进口。

Note that when pressing [Ctrl]+[Shift]+O all static import ending with * are resolved to indiviual imports.

这篇关于为什么eclipse不会在“快速修复”中显示lwjgl导入菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆