Jump to content
  • Advertisement
Sign in to follow this  
bensanx

OpenGL Rendering glitch in OpenGL code on Mac OSX

This topic is 764 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'm just porting an OpenGL app from Windows to Mac OSX and am experiencing some rendering issues (see attached screenshot). The scene (a simple rectangle, a ground plane) runs fine on windows (SDL2 + OpenGL context 2.2 and uses vertex buffers i.e. glvertexpointer etc). When running the the unaltered gl code on mac however looks like the triangle indices are all messed up. 

 

I've stepped through the code and can see the vertex and index data appears fine so was wondering if anyone has any ideas (based on the attached image). It's kind of tricky uploading the code as it lives in a framework but as mentioned unaltered the code runs fine on windows.

 

Any help would be much appreciated, thanks in advance. 

Share this post


Link to post
Share on other sites
Advertisement

It turned out to be a 32 / 64 bit issue. The original code was written for and targeted 32 bit Windows that I'm porting to 64 bit Mac. There was some int / long mismatching for the face indices (they were being loaded mistakenly loaded into a vertex buffer as longs which didn't match the int stride) resulting in only half the vertices being indexed correctly skipping every other index resulting in a fan like appearance. 

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!