GLFW是否设计为在不使用LWJGL的情况下使用(在Java中)? [英] Is GLFW designed to use without LWJGL (in java)?

查看:150
本文介绍了GLFW是否设计为在不使用LWJGL的情况下使用(在Java中)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道LWJGL只是OpenGL的包装器.这是一个Java库,旨在使用Java语言中的较低级别的OpenGL函数.

据我所知,GLFW只是一个库,可以创建更好的窗口来显示图形.因此,GLFW只是用于以比LWJGL更好的方式创建窗口的库.

GLFW不是用于创建图形,而是仅用于创建显示器吗? 而且GLFW不是一个人使用,您仍然应该只使用LWJGL库来访问OpenGL函数来创建图形吗?

有人可以解释为什么我会使用GLFW吗? 而且LWJGL3和GLFW之间似乎存在关系,但是它们之间有什么关系?

解决方案

GLFW不是用于创建图形,而是仅用于创建显示器吗?而且GLFW不是一个人使用,您仍然应该只使用LWJGL库来访问OpenGL函数来创建图形吗?

是的

有人可以解释为什么我会使用GLFW吗?而且LWJGL3和GLFW之间似乎存在关系,但是它们之间有什么关系?

主要原因是很难*使Java的Windowing API [-s]与OpenGL互操作.甚至当您确实让他们共同行动时,这样做也常常会受到相当大的性能损失.

另一方面,GLFW只不过是围绕环境的本机Windowing API(无论是Windows,MacOS还是Linux)的包装.表面上这就是Java的AWT API的本意,但是同样:AWT和Swing都有性能问题,而GLFW则没有.

LWJGL是GLFW的包装,也是更广泛的OpenGL API的包装,包括通常必须手动在C/C ++中加载的功能(通常通过所谓的GLEW或OpenGL Extension wrangler).它们之间不一定有关系,除了GLFW必须加载某些特定的OpenGL函数以确保它可以正确设置帧缓冲区并从OpenGL接收输入(并且在与各种OpenGL扩展接口时也可以正常运行)这一事实. ,但除此之外,两者本质上是独立的.

I know LWJGL is just a wrapper for OpenGL. It's a java library designed to use the lower level OpenGL functions in the java language.

As far as I understand now, GLFW is just a library which makes it possible to create better windows to display the graphics. So GLFW is just a library for creating windows in a better way than LWJGL did before.

Is it true that GLFW is not for creating graphics, but just for creating displays? And GLFW is not for using alone, you still should just use the LWJGL library to have access to the OpenGL functions to create graphics?

Can someone explain why I would use GLFW? And it seems there is a relation between LWJGL3 and GLFW, but what has it to do with each other?

解决方案

Is it true that GLFW is not for creating graphics, but just for creating displays? And GLFW is not for using alone, you still should just use the LWJGL library to have access to the OpenGL functions to create graphics?

Yes.

Can someone explain why I would use GLFW? And it seems there is a relation between LWJGL3 and GLFW, but what has it to do with each other?

The main reason is that it's difficult* to get Java's Windowing API[-s] to behave interoperably with OpenGL. And even when you do get them to behave together, there's often substantial performance penalties for doing so.

GLFW, on the other hand, amounts to little more than a wrapper around the native Windowing API of your environment, whether it be Windows, MacOS, or Linux. Ostensibly this is what Java's AWT API is supposed to be, but again: AWT and Swing have performance problems, GLFW does not.

LWJGL is a wrapper for GLFW, but also a wrapper for the broader OpenGL API, including functions you'd normally have to manually load in C/C++ (typically through what's called GLEW, or the OpenGL Extension wrangler). They don't necessarily have a relationship to each other except for the fact that GLFW has to load some specific OpenGL functions to ensure that it can set up framebuffers correctly and take input from OpenGL (and also behave correctly when interfaced with various OpenGL extensions), but other than that, the two are essentially independent.

这篇关于GLFW是否设计为在不使用LWJGL的情况下使用(在Java中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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