Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualZouflain

Posted 31 October 2012 - 10:00 AM

The last parameter, unless I'm sadly mistaken, is a pointer to the beginning of the data. If this is part of a buffer, it gets treated more as an offset then a direct pointer to memory. (void*)0 simply tells it "start at the beginning of the buffer" so if you have a vertex struct, the very first data entry in the struct should be this attribute. Typically when I get an error there (and I use only nvidia cards), it's because I've failed to enable that vertex array OR because I have passed an invalid value (like 8 instead of 3 floats). Be sure also that your shader program uses a vec3 when you pass it those 3 floats.

EDIT: Just though, also make sure that the layout of your shader program matches the order of the attribute arrays. Thus, attribute 0 must be a vec3 or other 3 float containing data type.

#1Zouflain

Posted 31 October 2012 - 09:59 AM

The last parameter, unless I'm sadly mistaken, is a pointer to the beginning of the data. If this is part of a buffer, it gets treated more as an offset then a direct pointer to memory. (void*)0 simply tells it "start at the beginning of the buffer" so if you have a vertex struct, the very first data entry in the struct should be this attribute. Typically when I get an error there (and I use only nvidia cards), it's because I've failed to enable that vertex array OR because I have passed an invalid value (like 8 instead of 3 floats). Be sure also that your shader program uses a vec3 when you pass it those 3 floats.

PARTNERS