I mean, the first code show something and the second show nothing…
I really don’t understand why a simple thing that only change value after the link instead of before can create a such problem. I’m sure I’ve made something stupid.
I never call hard coded number for shader attribute (I always use “_pointIndexAttr”).
What I don’t understand is that there is no place where it’s written that you need to call glUseProgram before glGetAttribLocation. It’s only write that this as to be done after glLinkProgram:
You are looking at the wrong document.
GetAttribLocation is described in GL spec.
Anyway, it seems that link also bind the program. So, it is not really necessary to cal UseProgram, at least on NV drivers (I’ve just tried successfully). But if you are reading attributes location just after linking, why don’t you set them with BindAttribLocation?
I have a ATI card, that’s maybe why there is some differences about this, even on Internet.
Yes, I could set them with BindAttribLocation but I wont to define indexes…
I use attribute mat4 value (you know, the attribute that have +1, +2, +3 once you get it) and as I’m not very familiar with it, you can do mistake if you bind them:
matrixAttr = 0
anAttr = 1
anotherAttr = 2
This is invalid because as matrixAttr is a mat4 attr, you will have 0, 1, 2, 3. and anAttr and anotherAttr are 1 and 2 so they are in conflict with it…
I won’t to lost my time with this I try to do simpler as possible and I was thinking use GetAttribLocation was the simpler way as it’s OpenGL that choose which index set to attributes.
Anyway, if you have good reading about how deal simply with manually binded attributes I would very graceful if you send them to me.