Jump to content
  • Advertisement
Sign in to follow this  
OpenGL_Guru

OpenGL my common openGL problems -- share yours please...

This topic is 4962 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 have trying to figure out a bug for a while now and thought it was something to do with the way i was calling glVertex() or that maybe my glBegin and glEnd was not in the same place. turns out that what the real problem was is what i assume many people have trouble with so i thought i would jot this down along with a few others as this might help someone. #1(the "bug" i just found). for(int i = 0; i < num; i++) { for(int j = 0; j < num2; j++); { } } yeah i know this maybe look simple to spot but when you have hundreds and even thousands of lines of code your eyes can quickly deceive you as you just "assume" maybe subconsciously that your loops set up right. #2 - Blending i have made this error many times as such: glEnable(GL_BLEND) glColor4f(1, 1, 1, 0.4); draw_something(); glDisable(GL_BLEND); draw_something_else(); this is for those who are brand new to openGL. ALWAYS do your blending LAST after you have drawn everything else. otherwise your "transparency" will look dull or have a gray color to it. so in this case put the draw_something_else() before you do any blending. #3. - Depth Buffer make sure your 3D vertex values do not end up being 6,000,000,000 etc etc because you will have serious issues, even if you have gluLookAt or similar set up to take on those kind of numbers. i have always found that limiting your values inside the thousands helps out tremendously and wont leave you wondering if you have your triangle_strips drawn right or not. so i guess i would ask any of you to post any of your common errors you have in openGL and how many times have you had problems with any of the 3 that i mentioned? anyway thanks!

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!