Ivan Ermolaev
Ivan Ermolaev

Reputation: 1032

Where is the function glCreateShaderObjectARB()?

Where is the function glCreateShaderObjectARB()? I included following:

#include <gl\GL.h>
#include <gl\wglext.h>
#include <gl\glext.h>

But I can't use glCreateShaderObjectARB() function!

Similary, I want to use:

glShaderSourceARB();
glAttachObjectARB();
glCompileShaderARB();
glLinkProgramARB();

and etc.

Upvotes: 1

Views: 1660

Answers (2)

Zhen
Zhen

Reputation: 4283

You should activate this prototype with a define before the include:

#define GL_GLEXT_PROTOTYPES 1
#include <GL/glext.h>

Upvotes: 0

Andon M. Coleman
Andon M. Coleman

Reputation: 43329

It is part of GL_ARB_shader_objects, and unless you have an OpenGL implementation that pre-dates 2.0 you should not use it. Use core GLSL instead, the function names are slightly different (e.g. glCreateShaderObjectARB (...) is glCreateShader (...)), but functionally they are the same.

Any tutorial you come across that uses the ARB extension should really be ignored as it is too old (10 years) to be considered relevant today.

Furthermore, unless you are on OS X, you are going to have to load this function using your platform's extension loading mechanism at run-time, including a header is not going to solve your problem. I would suggest you use GLEW to make life easier.

Upvotes: 2

Related Questions