MSVC OpenGL 1.2版在哪里找到? [英] MSVC OpenGL version 1.2 where to find?

查看:122
本文介绍了MSVC OpenGL 1.2版在哪里找到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为我的纹理设置一个钳到边缘"的环绕参数模式:

I need to set a "clamp-to-edge" wrap param mode to my texture:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);

在面向Win32平台的Microsoft Visual Studio C ++应用程序中.

in my Microsoft Visual Studio C++ application targeting Win32 platform.

这不起作用:

错误C2065:"GL_CLAMP_TO_EDGE":未声明的标识符

error C2065: 'GL_CLAMP_TO_EDGE' : undeclared identifier

我了解原因:"C:\ Program Files(x86)\ Microsoft Visual Studio 8 \ VC \ PlatformSDK"包含OpenGL 1.1版,而GL_CLAMP_TO_EDGE是在1.2版中引入的.

I understand the reason: "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK" contains OpenGL version 1.1 whereas GL_CLAMP_TO_EDGE was introduced in the version 1.2.

我试图将其定义为

#define GL_CLAMP_TO_EDGE 0x812F

但没有效果.

因此,我需要针对Windows的较新的(至少是1.2版)OpenGL库进行链接.我的问题是:我在哪里可以得到它?

So, I need to link against a newer (at least version 1.2) OpenGL library for Windows. My question is: where can I get it?

推荐答案

要访问OpenGL 1.2或更高版本,您需要使用扩展加载机制.建议您查看此问题 GLEW GLEE .这些会在运行时自动加载OpenGL扩展,以允许您使用现代的OpenGL功能.

To get access to OpenGL 1.2 or greater, you need to use the extension loading mechanism. I suggest you look at this question or this one, or tl:dr, look at GLEW or GLEE. These automatically load OpenGL extensions at runtime to allow you to use modern OpenGL functionality.

这篇关于MSVC OpenGL 1.2版在哪里找到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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