odd problems with NSData / OpenGL
odd problems with NSData / OpenGL
- Subject: odd problems with NSData / OpenGL
- From: Henri Häkkinen <email@hidden>
- Date: Tue, 8 Dec 2009 09:46:08 +0200
Hello.
I have odd problems with using NSData, maybe someone could point me what's going wrong here.
I have a simple Cocoa document-based application, which uses a custom NSOpenGLView derived class. This view object has a reference to the document object (this binding is set in the nib file), and the document has a reference to a Mesh class. Mesh loads vertices and indexed triangular faces from a file, and stores them as NSData objects containing vertex arrays, intended to be used with glVertexPointer etc. OpenGL calls.
The mesh is drawn in drawRect: of the view class using OpenGL. First call of this method works fine and the mesh is rendered. However, after calling setNeedsDisplay (for example in reshape method or anywhere) the program crashes with EXC_BAD_ACCESS when the drawRect method is trying to access the NSData objects of the mesh. Using the debugger I can see that the pointers (both the document reference, mesh reference and the NSData pointers inside the mesh) remain the same between the calls of drawRect:, as in nothing seems to get overwritten accidentally or anything.
What might be causing this problem? Any ideas?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden