Stumped by EXC_BAD_ACCESS
I have no clue why I am getting a EXC_BAD_ACCESS by a simple glDisable:
Thread 0 Crashed:
0 libGL.dylib 0x90c32c1c glDisable + 0x2c
is there ANY troubleshooting I can do to figure out the real cause?
Edit (5minutes later): Wow, I am a moron
I think I didn't initialize my context yet. I commeted out a lot of AGL code (to move to NSGL), and was just compiling libraries to see what ran and what didn't. Well, I forgot to add the NSGL context init code 
We'll see...
Thread 0 Crashed:
0 libGL.dylib 0x90c32c1c glDisable + 0x2c
is there ANY troubleshooting I can do to figure out the real cause?
Edit (5minutes later): Wow, I am a moron
I think I didn't initialize my context yet. I commeted out a lot of AGL code (to move to NSGL), and was just compiling libraries to see what ran and what didn't. Well, I forgot to add the NSGL context init code 
We'll see...
It's really a big PITA that gl calls crash when you don't have a context. For beginners, this is usually the first thing that gets them stumped. It could give you some sensible information at least.
I just have so many things going on at once
Trying to push the Carbon version out of the door, but I want to get the Cocoa version done by the time we support Localized strings.
Trying to push the Carbon version out of the door, but I want to get the Cocoa version done by the time we support Localized strings.
Crashing is giving you more information than silently doing nothing.
arekkusu Wrote:Crashing is giving you more information than silently doing nothing.True, but it doesn't tell you what is wrong either. If you are a seasoned OpenGL dev, you will know where to search, but a beginner isn't helped.
It may also be incorrect OpenGL behavior. Shouldn't it set an error code you can retrieve with glGetError()? It does on Win32 if you try to do that. It's a pretty weird error (the same one you get if you try to do invalid operations inside a glBegin/glEnd) but it does give one.
It's not, I already fixed the problem (listed above). Just a matter of not updated commented out Carbon code to Cocoa code. Now on to mind boggling event stuff...
DoG Wrote:True, but it doesn't tell you what is wrong either. If you are a seasoned OpenGL dev, you will know where to search, but a beginner isn't helped.
Hmmm.....
In my first game I had trouble with arrays and aglSwapContext.
I over-stepped an array with a while loop and called some glvertex functions...

When I call aglSwapContex the video card would freeze (mouse and all would freeze).
I learned a long, long, time ago to check your if, while, for, and arrays for any problems first.
(pointers second)
Dan Potter Wrote:Shouldn't it set an error code you can retrieve with glGetError()?You can't ask the context what the last error was if you don't have an active context.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| EXC_BAD_ACCESS with gluBuild2DMipmaps | Marjock | 3 | 2,954 |
Aug 5, 2007 01:38 AM Last Post: Marjock |
|
| OpenAL, Ogg/Vorbis music, and EXC_BAD_ACCESS | 0ctane | 10 | 6,299 |
May 28, 2006 01:43 PM Last Post: OneSadCookie |
|
| open AL crash with EXC_BAD_ACCESS | carlo | 9 | 3,676 |
Apr 12, 2006 09:23 PM Last Post: Sabrina |
|
| glGenTextures and EXC_BAD_ACCESS | BobbyWatson | 1 | 3,948 |
Aug 31, 2002 01:48 PM Last Post: BobbyWatson |
|

