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

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

问题描述

我知道 LWJGL 只是 OpenGL 的包装器.它是一个 Java 库,旨在使用 Java 语言中较低级别的 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.

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

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.

GLFW 真的不是用于创建图形,而只是用于创建显示吗?而且 GLFW 不是单独使用的,你还应该使用 LWJGL 库来访问 OpenGL 函数来创建图形吗?

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?

有人可以解释我为什么要使用 GLFW 吗?而且LWJGL3和GLFW之间似乎有关系,但两者有什么关系?

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?

推荐答案

GLFW 真的不是用于创建图形,而只是用于创建显示吗?而且 GLFW 不是单独使用的,你还应该使用 LWJGL 库来访问 OpenGL 函数来创建图形吗?

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?

是的.

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

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?

主要原因是很难*让 Java 的 Windowing API[-s] 与 OpenGL 进行互操作.即使您确实让它们一起表现,这样做通常也会对性能造成严重影响.

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 只不过是您环境(无论是 Windows、MacOS 还是 Linux)的原生 Windowing API 的包装器.表面上这就是 Java 的 AWT API 应该是什么,但同样:AWT 和 Swing 有性能问题,GLFW 没有.

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 是 GLFW 的包装器,也是更广泛的 OpenGL API 的包装器,包括您通常必须在 C/C++ 中手动加载的函数(通常通过所谓的 GLEW 或 OpenGL 扩展管理器).除了 GLFW 必须加载一些特定的 OpenGL 函数以确保它可以正确设置帧缓冲区并从 OpenGL 获取输入(并且在与各种 OpenGL 扩展接口时也能正确运行)之外,它们之间不一定有关系,但除此之外,两者本质上是独立的.

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天全站免登陆