在 OpenGL 中使用 PNG 纹理的最快、最简单的方法

发布于 2024-10-05 03:18:00 字数 199 浏览 0 评论 0原文

我正在寻找在 OpenGL 中使用 PNG(带有 alpha 值)纹理的最快、最简单的方法。我尝试过许多不同的库,但大多数都臃肿且难以在 Mac 上编译/工作。

我对 OpenGL 纹理和所有“陷阱”不是很熟悉,所以我把重点放在简单上。

如果解决方案涉及链接库,如果有人能给我一个很好的 makefile 示例,那将非常有帮助。

谢谢!

I am looking for the fastest and easiest way to use PNG (with alpha values) textures in OpenGL. I have tried many different libraries but most are bloated and hard to get compiled/working on a Mac.

I'm not very familiar with OpenGL textures and all of the "Gotchas" so I am putting emphasis on the Simple.

It would be very helpful if someone could give me a nice makefile example if the solution involves linking a library.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

一梦等七年七年为一梦 2024-10-12 03:18:00

您可以尝试一下SOIL

You might give SOIL a whirl.

拿命拼未来 2024-10-12 03:18:00

sdl 和 sdl_image 是我所知道的最简单的方法:
http://www.libsdl.org/
http://www.libsdl.org/projects/SDL_image/

但是,这是跨平台的。对于仅适用于 Mac,我想有一个本地替代方案。

sdl and sdl_image is the simplest way I know of:
http://www.libsdl.org/
http://www.libsdl.org/projects/SDL_image/

However, this is for cross-platform. For Mac-only I guess there is a native alternative.

塔塔猫 2024-10-12 03:18:00

DevIL 可以非常简单轻松地完成此操作,适用于多种格式。它还有一个与 OpenGL 非常非常相似的 API(根据设计,大多数常量是相同的,等等)。我只花了几分钟就将它连接到我拥有的 OpenGL 应用程序中。这些文档不是很好,但它可以完成工作并且支持很多格式。

DevIL can do this pretty simply and easily, for quite a few formats. It also have a very, very similar API to OpenGL (by design, most constants are identical, etc). It took me just a few minutes to hook it into an OpenGL app I had. The docs aren't great, but it does the job and supports a lot of formats.

梅窗月明清似水 2024-10-12 03:18:00

glpng 是一个 png opengl 加载器实用程序库,尽管人们可以做它所做的事情只需 libpng 和 gl,它就可以在一次调用中从 png 文件加载到纹理中

glpng is a png opengl loader utility library although one can do what it does with just libpng and gl it loads from a png file into a texture for you in one call

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文