0
votes

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);

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

This does not work:

error C2065: 'GL_CLAMP_TO_EDGE' : undeclared identifier

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.

I tried to define it as

#define GL_CLAMP_TO_EDGE 0x812F

but it had no effect.

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?

1

1 Answers

3
votes

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.