🔒 Locked
including shaders
Advertisement
Original Post
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.
check the NVIDIA sdk.
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 would reccomend the tutorials over at clockworkcoders.com and lighthouse3d.com for getting started with shaders.
I would also get a copy of the Orange Book as well.
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#endifSo, 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?
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 properlyGLAPI 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
download and use GLee (link in Forum FAQ), and you can stop worrying about all the extension stuff [smile]
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?
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?
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:
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?
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?
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement