Man I need help so bad! Quickly too!

This is typical! I have a deadline for my project July 10th, things were going great, most of my little game was done and I was really happy.

Now I get an illegal operation error each time I start it. And if I debug I get a list with a lot of asm-code and it says “acces violation”. I’m using Visual C++ 5.0. Is there anyway to get VC to just point me to which part of my code causes the problem?

The strange thing is that I didn’t DO anything to the code!
I implemented the a performance counter according to tutorial 21 on NeHe’s site. And it worked perfectly. Things were a little slow so I tweaked ONE variable. Tried it again and the speed issue was resolved, however one of my two textures (I only use two) didn’t show. I was like “wtf!?”, so I changed the texture-bind for the texture that didn’t work to point to the one that worked instead, and now both my objects were drawn with the same texture. So i tried setting them both the the one that didn’t work. And that’s when I got my first error-message message.
So I looked around and saw that the variable holding the name for the texture objects read
GLuint texture[1]; instead of GLuint texture[2];
This puzzled me because it worked before, and I’m pretty certain I set it to 2.
Anyway, I changed it back to 2 but it still didn’t work.

So now I commented out all the code that could cause trouble. The text-code, the timer-code (I reinserted the timeGetTime() multimedia timer). And it still crashes on startup.

I’m about to kill myself. I mean things were going so great and this **** has to happen!
I HAVE to get this project done by the 10th or I’m screwed. This really is a dead-line.

Any ideas?

You HAVE to help me here!
I’m going insane! I think I’m about to cry. I have no idea how the debugger works in VC.

Have you checked the call stack when it crashes? That should point you to the function in your app that is causing the problem. Put a breakpoint on that function when debugging the app again, and then step through your code very carefully. You should then be able to find the line in your code that goes astray. Then you have to figure out why it is going astray. That’s the best advice I can give. Besides other tips that won’t be helpful to you now that is.

[This message has been edited by DFrey (edited 06-26-2000).]

I used to get access violation when I try to use a texture without dimensions, or bad data type (I mean RGBA insted of RGB).

Do you create your texture ID’s correctly?
When you draw your objects do you set these ID’s?
Do you have enough memory?

There could be a problem when you do openGL operations before creating the rendering context.

Hmm… You’re not gonna believe this. In fact, I’m not sure I believe it. But it works.
I didn’t do ANYTHING. Just recompiled a couple of times and scratching my head. And today when I turned on the computer, things worked.
This is making me nervous.
I would prefer to know WHY it didn’t work, and why it works now, all of a sudden.

When this sort of stuff happens to me and I have absolutely no clue as to why an error occurs,I use message boxes all over my application (or in the function that I think the error is occuring in)And when I run my app I know exactly where the error occurs. It’s a cheesy method but it works

I occasionnaly have that sort of problem when I change a class declaration (the header). For example adding or removing a class member (variable) or something like that. The problem always comes from the pre-compiled header (stdafx.h/.cpp). It seems that this header is aware of the changes but it does not communicate the changes to all the .obj files… Which means the other .obj files do not have the proper offset from the beginning of the class to access the member… which leads to nice problems !

The only solution I have found up to now is to perform a Rebuild All when I do such changes…

Hope this will help you !



sometimes error such as that occur when a fan on a processor quits, check that, however almost anything could be the source of your problem…