Jump to content
  • Advertisement
Sign in to follow this  
NimrodPSI

OpenGL Strangest quirk i ever found

This topic is 3615 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, so this is probably the most confusing but simple seeming problem i've encountered in openGL. Im using Microsoft Visual C++ 6.0 with openGL and i do alot of copy and paste programming from my own programs to new ones for simplicity and consistancy between them. Twice now a new program modeled off an old one will become dependent on a seemingly random variable, without this variable somthing in the new program won't work. For example the two instances i've encountered were: 1. No GL renderd text was being displayed without the variable GLint jtimer. 2. This was a different program without the previous stated problem and it would only load the texture stored in the [0] slot for my texture array, any other texture wouldn't be displayed unless i included the variable (from the program it was modeled off) GLdouble shellDirX. In both of these occurances i went through eliminateing stuff that changed between the two programs until the problem was isolated to these variables, which i can change the type of with no error, but not the name. So, bool jtimer or int shellDirX still work fine but not GLint jtimr. I have checked all through out the program to make sure the variable wasn't being used anywhere. This is probably the strangest thing i've dealt with so far programming and any help would be greatly appriciated! Oh and merry christmas!

Share this post


Link to post
Share on other sites
Advertisement
Try another texteditor and check if you have a clean environment with no outdated temporary files

Share this post


Link to post
Share on other sites
Quote:
Original post by NimrodPSI
This is probably the strangest thing i've dealt with so far programming and any help would be greatly appriciated!

This is not strange at all, these type of problems are very common. It's a symptom of stack corruption. The variables themselves are just visible manifestations of a deeper problem somewhere else. Something in your common code is corrupting the stack. Once this happens, your program will become dependent on the specific stack frame layout in a function. By adding local variables, you will modify the local stack frame layout. They can thus hide the corruption, but not eliminate it.

In other words, look for the code actually responsible for the corruption and fix it. Then this effect will go away.

BTW, you should really not be using VC6 anymore.

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!