Re: Can't get OpenGL to work
Re: Can't get OpenGL to work
- Subject: Re: Can't get OpenGL to work
- From: Thomas Lachand-Robert <email@hidden>
- Date: Sun, 24 Mar 2002 23:25:51 +0100
Le dimanche 24 mars 2002, ` 10:41 , Drew Cunningham a icrit :
It seemed like simple code, but I can't get this OpenGL code to show
anything. Am I missing something? I've set the custom view as a
MyOpenGLView, and here is the code for it:
(...)
- (void)drawRect:(NSRect)rect
{
[[self openGLContext] makeCurrentContext];
// Basic drawing routine. Override of drawRect function
(...)
// Update the GL context
[[self openGLContext] flushBuffer];
}
I don't know for sure in your case, but you should use glFinish ();
instead of the call to flushBuffer. Also you don't need makeCurrentContext,
it is already done when drawRect is called (by lockFocus I suspect).
If that still doesn't work, there are a lot of working examples on the net,
including at Apple, that you can use and modify to your needs. See for
instance
http://developer.apple.com/samplecode/Sample_Code/Graphics_3D.htm
Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.