OpenGL Troubles
OpenGL Troubles
- Subject: OpenGL Troubles
- From: Dietrich Epp <email@hidden>
- Date: Mon, 24 Feb 2003 00:56:46 -0800
I am trying to use OpenGL in Cocoa, but can't use NSOpenGLView because
my view is sometimes an OpenGL view and sometimes not. So I gave it an
_openGLContext ivar, and initialized it the following way:
...
pixelFormat = [[NSOpenGLPixelFormat alloc]
initWithAttributes:attributes];
if (pixelFormat) {
_openGLContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat
shareContext:nil];
if (_openGLContext) {
[_openGLContext setView:self];
...
In -lockFocus, I call
[_openGLContext makeCurrentContext];
But I get an "invalid drawable" message! I know that the current
context is the right one, and that it -update'd with the latest view
information goodness. Am I missing anything? Has anyone else used
NSOpenGLContext without an NSOpenGLView (I did see it in the Omni game
source, but that was no help).
_______________________________________________
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.