Sign in to follow this  

including shaders

This topic is 4336 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently a little bored with my skeletal animation not working, so I've decided to leave that for a bit and come back to it. I'd like to do some work with shaders. I'm using NeHe article 21 to find out how to set them up. I've found that the definitions are supposed to be in the file "glext.h", right? I haven't been able to find it on my computer. I would have thought that since all the other gl header had been included with winXP SP2, I would have had that one.

Share this post


Link to post
Share on other sites
Those are all in the OpenGL SDK here: http://oss.sgi.com/projects/ogl-sample/sdk.html

I would reccomend the tutorials over at clockworkcoders.com and lighthouse3d.com for getting started with shaders.

Share this post


Link to post
Share on other sites
Quote:
Original post by eviltwigflipper
I would also get a copy of the Orange Book as well.


As soon as I can start affording textbooks again. [grin]

Share this post


Link to post
Share on other sites
Quote:
Original post by luridcortex
Those are all in the OpenGL SDK here: http://oss.sgi.com/projects/ogl-sample/sdk.html

I would reccomend the tutorials over at clockworkcoders.com and lighthouse3d.com for getting started with shaders.

I've downloaded the header files and saved them into the right folder.

But, I'm getting "error C2065: 'glCreateProgramObjectARB' : undeclared identifier". I've taken a look in the "glext.h" file and the prototypes block where "glCreateProgramObjectARB" is declared is wrapped in

#ifdef GL_GLEXT_PROTOTYPES
// declarations
#endif

So, my theory is that GL_GLEXT_PROTOTYPES isn't being defined, and I can't find the place where it should be.

And what's this little bit about?
Quote:

Based on the extension headers, Intel has created the GLsdk library to ease use of OpenGL extensions, by providing a static library containing wrapper functions for extensions which otherwise must be accessed by use of wglGetProcAddress on Windows and glXGetProcAddressARB on Linux.

What is wglGetProcAddress used for?

Share this post


Link to post
Share on other sites
I have it compiling, but I have to put a bunch of declarations at the top:

// DEBUG - Just until I get the header file working properly
GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
// DEBUG

Share this post


Link to post
Share on other sites
Another question:


When compiling, attaching and linking shaders, how should the attaching and linking be done?

I mean, you compile and then attach a shader to the program, should you link directly after? Or should you attach all the shaders you are going to, and then link? I'm assuming that it's the second, but, is it possible to attach more shaders to a program and then link again? Or unattach and then link again?

Share this post


Link to post
Share on other sites
I've decided to seperate everything into proper classes.

I have a class for a shader program, a class for a vertex shader and a class for a fragment shader. The diff between the vertex and frag shader is only the constructor.

Problem is, I keep getting:

test.obj : error LNK2001: unresolved external symbol "unsigned int __stdcall glCreateShaderObjectARB(unsigned int)"
(?glCreateShaderObjectARB@@YGII@Z)
test.obj : error LNK2001: unresolved external symbol "void __stdcall glDeleteObjectARB(unsigned int)"
(?glDeleteObjectARB@@YGXI@Z)


And, I'm not really sure why. I mean I'm linking to the opengl libraries "OpenGL32.lib" and "GLu32.lib" in a couple of files, including these ones.

Are there particular libraries for the opengl extensions that I have to link to?

Share this post


Link to post
Share on other sites

This topic is 4336 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this