Jump to content
  • Advertisement
Sign in to follow this  
druide

OpenGL sum

This topic is 4988 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 search how can i do a sum in opengl language, for example with the command "for".... In order to program different mathematicals aplications...

Share this post


Link to post
Share on other sites
Advertisement
OpenGL(Open Graphics Library, IIRC) is a graphics library, not a language... Maybe your thinking of C or C++(they're probably the most commonly used languages that have OpenGL implementations)?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think he means the OpenGL shading language, ie. GLSL. You already answered your own question though: to do loops in GLSL, you use "for"... what a surprise :)

Not all cards will be able to natively do looping though. Loops with a fixed number of iterations can almost always be unrolled, and will probably work anywhere. Non fixed ones will require conditional jumps. Some chipsets will only allow conditional jumps in vertex shaders, and only the most recent chipsets allow them in fragment shaders. Many older chipsets won't allow any conditional jumps at all (and compilation of code with a variable amount of iteration loops will fail).

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!