C++ 如何开始使用OpenGL和C++进行开发,windows上需要安装哪些工具

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2254706/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 22:44:27  来源:igfitidea点击:

How to start developing with OpenGL and C++, what tools do I need to install on windows

c++windowsopengl

提问by Chris Barry

I am inspired to start programming some things in OpenGL, using c++.

我受到启发,开始使用 C++ 在 OpenGL 中编程一些东西。

Can anyone list here what tools should be installed to start this process.

任何人都可以在这里列出应该安装哪些工具来启动这个过程。

Ie

IE

IDE Compiler OpenGL download etc?

IDE Compiler OpenGL 下载等?

回答by Jerry Coffin

The Ne-He tutorials (to which @wich has already kindly provided a link) are quite good for what they are (but at least the last time I looked carefully, the OpenGL the teach and work with is quite dated).

Ne-He 教程(@wich 已经友好地提供了一个链接)非常适合它们的内容(但至少在我最后一次仔细查看时,教学和使用的 OpenGL 已经过时了)。

glut, however, I'd generally avoid. It has a fair number of bugs, and nobody's working on fixing them. It was basically abandoned in a beta test state in the late 1990s, so it seems doubtful (at best) that anybody will ever even try to fix them.

过剩,但是,我通常会避免。它有相当多的错误,而且没有人致力于修复它们。它在 1990 年代后期的 beta 测试状态中基本上被放弃了,因此似乎(充其量)有人甚至会尝试修复它们似乎是值得怀疑的。

A couple of alternatives to glut (both apparently in active development) are GLFWand FLTK. Between these, GLFW is much closer to glut in character -- a small toolkit for abstracting away most of the OS-dependent parts, so you can produce OpenGL programs with relatively little hassle. FLTK is really a full-blown GUI toolkit (though rather small as GUI toolkits go) that has a built-in glut emulation (that, at least the last time I played with it, seemed considerably better implemented than glut itself).

glut 的几个替代品(显然都在积极开发中)是GLFWFLTK。在这两者之间,GLFW 更接近于特性过剩——一个用于抽象掉大部分操作系统相关部分的小工具包,因此您可以相对较少地生成 OpenGL 程序。FLTK 确实是一个成熟的 GUI 工具包(尽管与 GUI 工具包相比相当小),它具有内置的 glut 仿真(至少在我最后一次使用它时,它的实现似乎比 glut 本身要好得多)。

I suppose I should also point out one more alternative to glut: freeglutis a free re-implementation of the glut API. I can't say I really recommend it, but at least it's been actively developed a lot more recently than the original glut.

我想我还应该指出 glut 的另一个替代方案:freeglut是对 glut API 的免费重新实现。我不能说我真的推荐它,但至少它最近比最初的过剩更积极地开发。

When/if you decide you want to play around with shaders, both AMDand nVidiahave developer web pages. nVidia's, in particular, has a huge amount of free "stuff" available (just beware that it's easy to burn all too many hours playing around with their demos and such).

当/如果您决定使用着色器,AMDnVidia都有开发人员网页。尤其是 nVidia 有大量免费的“东西”可用(请注意,玩他们的演示等很容易消耗太多时间)。

回答by Chris Becke

The following three IDEs are very usable, and can all be used for c++ OpenGL development. Qt is more of a cross platform framework, but all can be used to develop glut based OpenGL apps.

以下三个IDE非常好用,都可以用于c++ OpenGL开发。Qt 更像是一个跨平台框架,但都可用于开发基于 glut 的 OpenGL 应用程序。

回答by mlvljr

Here is my piece of (a former OpenGL toyer's) advice on the choice of libraries and tools (as for the compiler, you can just use any free modern one out there (i.e., gcc or VSExpress C++)):

这是我关于库和工具选择(至于编译器,您可以使用任何免费的现代工具(即 gcc 或 VSExpress C++))的(以前的 OpenGL 玩具)建议:

  1. Do not forget to look at GLEW (The OpenGL Extension Wrangler Library)or GLee (GL Easy Extension library), especially if you'd like to be stick with more modern OpenGL features (including advanced shaders).

  2. Something named like Shader Debuggerwill probably also be of great benefit when toying with shaders, as it will give the opportunity to see shader effect immediately without even compiling any C/C++ sources.

  3. Looking at the "traditional" (covered in the (free now) "Red book") functionality from the modern (i.e. shaders again:)) viewpoint may also be enlightening, the "Orange book" ("OpenGL Shading Language (3rd Edition))"has a chapter on emulating OpenGL fixed functionality with shaders.

  1. 不要忘记查看GLEW (The OpenGL Extension Wrangler Library)GLee (GL Easy Extension library),特别是如果您想坚持使用更现代的 OpenGL 功能(包括高级着色器)。

  2. 在使用着色器时,名为Shader Debugger 之类的东西可能也很有用,因为它可以立即看到着色器效果,甚至无需编译任何 C/C++ 源代码。

  3. 从现代(即再次着色器:))的角度来看“传统”(在(现在免费)“红皮书”中涵盖)功能也可能具有启发性,“橙皮书”(“OpenGL 着色语言(第 3 版)”) )”有一章是关于用着色器模拟 OpenGL 固定功能的。

回答by FrustratedWithFormsDesigner

No special OpenGL-specific compiler or IDE should be needed. All you need is a C++ compiler. VisualStudio Express Edition C++ should be able to do it. You can also go with NetBeans or Eclipse, both of which have C++ editions now. They may also have OpenGL plugins, specifically, I recall hearing about a GLSL shaders plugin for NetBeans (but that was a while ago, so that info may be out of date). Don't forget to check out the OpenGL SDK page, which also has some good tools and references.

不需要特殊的 OpenGL 特定的编译器或 IDE。您只需要一个 C++ 编译器。VisualStudio Express Edition C++ 应该可以做到。您还可以使用 NetBeans 或 Eclipse,它们现在都有 C++ 版本。他们可能也有 OpenGL 插件,具体来说,我记得听说过 NetBeans 的 GLSL 着色器插件(但那是前一段时间,所以该信息可能已过时)。不要忘记查看OpenGL SDK 页面,它也有一些很好的工具和参考。

The main OpenGL site is also a good resrouce to start with: http://www.opengl.org/(and someone else mentioned the NeHe tutorials- they're also great!)

主要的 OpenGL 站点也是一个很好的资源:http: //www.opengl.org/(其他人提到了NeHe 教程- 它们也很棒!)

回答by wich

You may want to have a look at the NeonHelium OpenGL tutorials

你可能想看看NeonHelium OpenGL 教程

回答by Manuel

Stay away from GLUT it is a crutch at best, you really need to learn how to use the OpenGL Api's directly to do high performance graphics. Also alot of the NeHe tutorials are old and outdated. There are lots of new Api's for the newer graphics cards that those tutorials don't cover.

远离 GLUT 它充其量只是一个拐杖,您真的需要学习如何直接使用 OpenGL Api 来制作高性能图形。也有很多 NeHe 教程是旧的和过时的。对于这些教程没有涵盖的较新的显卡,有很多新的 Api。