c++ 的 OpenGL 实现列表 [英] List of OpenGL implementations for c++

查看:72
本文介绍了c++ 的 OpenGL 实现列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是将我的项目从 Visual Studio 迁移到 Eclipse,所以我可以为 Linux 构建它们,但是我遇到了 OpenGl 库文件的问题.Visual Studio 带有 Microsoft 的库和头文件,用于在项目中包含 OpenGL,但 Eclipse 并非如此.我不知道那些 Microsoft 的文件使用了什么许可,所以我不想只是从他们的 SDK 中窃取"它们,但我找不到任何替代方案.我只找到了 MESA.它应该类似于 OpenGL,但我不确定有什么区别.那么,如果不是微软的,我有哪些选择?

I'm just migrating my projects from Visual Studio to Eclipse, so I can build them for Linux, but I've run into problem with OpenGl library files. Visual Studio comes with Microsoft's library and header files for including OpenGL in projects, but this is not the case with Eclipse. I don't know what licensing is used for those Microsoft's files, so I don't want just to "steal" them from their SDK, but I can't find any alternative. I've found just MESA. It should be OpenGL-like but I'm not sure what's the difference. So what are my options for including if not Microsoft's one?

我一直在阅读 MESA,我可以说这不是一个选项.他们声明他们的 GLSL 编译器只支持 1.2 版.那是非常古老的.我的项目至少需要 GLSL 1.5.

I've been reading through MESA a bit and I can say that it's not an option. They state that their GLSL compiler support only version 1.2. That is VERY old one. I need for my projects at least GLSL 1.5.

推荐答案

OpenGL 不是某个库,而是一个 API.安装的图形驱动程序实现 OpenGL,您的程序从驱动程序加载 OpenGL.Mesa3D 是一套开源驱动程序和适用于 Linux 的 OpenGL API 实现.但是,如果您安装 NVidia 或 AMD/ATI 专有驱动程序,则会在您的系统上实现 OpenGL.

OpenGL is not some library, but an API. The installed graphics driver implement OpenGL and your programm loads OpenGL from the drivers. Mesa3D is the set of open source drivers and implementation of the OpenGL API for Linux. But if you install NVidia or AMD/ATI propriatary drivers, it will be those who implement OpenGL on your system.

对于开发,唯一需要知道的是,您的程序应动态链接 libGL.so (Linux) 或 opengl32.dll (Windows),并且 OpenGL-1.1 以外的任何功能都是通过所谓的扩展系统提供,最容易通过像 GLEW 这样的库(http://glew.sf.net).

For development the only thing you need to know is, that your program shall dynamically link against libGL.so (Linux) or opengl32.dll (Windows) and that any functionality beyond OpenGL-1.1 is made available through the so called extension system, which is most easily utilized through a library like GLEW ( http://glew.sf.net ).

无需安装或链接到程序中的库!

系统的 OpenGL 实现当然是一个库,但所有 OpenGL 实现都实现相同的 API,而您使用的正是这个 API.

The OpenGL implementation of a system is, of course, a library, but all OpenGL implementations implement the same API, and it is this API you use.

对于 Windows 下的开发,编译器应该提供正确的头文件(MinGW、Cygwin 和 Microsoft 的 SDK 随附),以及一个名为 opengl32.lib 的链接器信息库存根.

For development under Windows the compilers should ship the right headers (MinGW, Cygwin and Microsoft's SDK come with it), plus a linker information library stub called opengl32.lib.

在用于开发的 Linux 下,您安装 Mesa3D 开发库,它为您提供最少的头文件和存根 libGL.so 为链接器提供信息以将正确的导入表构建到可执行文件中.

Under Linux for development you install the Mesa3D development libraries, which supply you with the minimal header and a stub libGL.so giving the linker the information to build the right import table into the executable.

您的程序不需要包含一些 OpenGL,而是希望它安装在系统上——这是一个非常安全的假设.甚至 Windows Vista 和 7 也带有一些 OpenGL 实现,而在 Linux 中它是一个常见的安装东西.在 MacOS X 上它始终存在,因为整个 OS X GUI 建立在 OpenGL 之上.

Your program doesn't need to include some OpenGL, but rather expects it to be installed on the system – an assumption very safe to be made. Even Windows Vista and 7 ship with some OpenGL implementation and in Linux it's a commonly installed thing. On MacOS X it's always present, as the whole OS X GUI builds upon OpenGL.

这篇关于c++ 的 OpenGL 实现列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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