Visual Studio C ++ 2010 express和OpenGL [英] Visual Studio C++ 2010 express and OpenGL

查看:318
本文介绍了Visual Studio C ++ 2010 express和OpenGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要能够从VisualC ++ 2010编译OpenGL4.1(C / C ++)应用程序。

I want to be able to compile OpenGL4.1 (C/C++) applications from VisualC++ 2010.

搜索后,我发现:
http://www.opengl.org/sdk/
和文档:(其是罚款)
http://www.opengl.org/sdk/docs/man4 /

这有点混乱,我真的不知道要安装什么才能开始。我甚至不能找到下载链接,或者我应该使用什么OpenGL项目。

Which is a bit confusing, and I really don't know what to install to get started. I can't even find a download link, or what OpenGL projects I should use.

推荐答案

任何使用OpenGL。只需添加

You don't need to download anything to use OpenGL. Just add

#include <gl/GL.h>
#include <gl/GLU.h>

到您的源文件的顶部。你还需要链接库,这在MSVC可以这样做:

to the top of your source file. And you also need to link the libraries, which in MSVC can be done like this:

#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")

微软提供的头文件,你被困在版本1.1的ogl。我建议从OpenGL网站,以及像GLEW得到最新的扩展头。这将允许您访问OpenGL中最新的可用函数和常量。

With the header files provided with microsoft, you are stuck with version 1.1 of ogl. I suggest getting the latest extension headers from the OpenGL website, as well as something like GLEW. This will give you access to the latest available functions and constants in OpenGL.

这篇关于Visual Studio C ++ 2010 express和OpenGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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