Jump to content
  • Advertisement
Sign in to follow this  
Muncher

Whats the difference between these functions?

This topic is 4979 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

Hello, stupid question time :) I can't find any docs on what the difference is beween each of these functions... glUniform1ivARB glUniform2ivARB glUniform3ivARB glUniform3ivARB also, what does the "iv" part of the function mean? Cheers Paul

Share this post


Link to post
Share on other sites
Advertisement
http://developer.3dlabs.com/openGL2/slapi/UniformARB.htm iv means array of integers.

int nValues = {1,1,1,1}
glUniform4iv(x,nValues);

Share this post


Link to post
Share on other sites
Yep, i've had a look at that :) thanks.
But for the life of me, i can't figure out what they do differently..... they are even used in the same manor.

More specifically, i want to know what the "1iv" means in the function name; ie the "3f" part of glVertex3f means there are three parameters of type float.... so how does "1iv" read?

Share this post


Link to post
Share on other sites
oops, sorry, read my previous post, I edited it in. glVertex3fv exists too, which would take the values from an array. You should bookmark that site, it's a good opengl reference, and easy to browse quickly.

http://developer.3dlabs.com/glmanpage_index.htm

Share this post


Link to post
Share on other sites
what does the "4" mean in glUniform4iv(x,nValues);

obviously its not 4 parameters :)
thanks for the help so far!

Share this post


Link to post
Share on other sites
Quote:
Original post by Muncher
what does the "4" mean in glUniform4iv(x,nValues);

obviously its not 4 parameters :)
thanks for the help so far!


Yes, it's four parameters, but they come from the array. It's the same as calling glUniform4i(), except you have the values in an existing array.

Share this post


Link to post
Share on other sites
Quote:
The number specified in the name of the command indicates the number of components for each element in value , and it should match the number of components in the data type of the specified uniform variable (e.g., 1 for float, int, bool; 2 for vec2, ivec2, bvec2, etc.).

see link above!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!