Strangest quirk i ever found

Started by
1 comment, last by Yann L 15 years, 4 months ago
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!
Advertisement
Try another texteditor and check if you have a clean environment with no outdated temporary files
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.

This topic is closed to new replies.

Advertisement