Hi, I am trying to create a display list in openGL and cannot figure out why it is not working. To trouble-shoot the problem, I have put the code for the display list inside "initWithFrame":
I have inserted code with the function "glIsList()" to test whether the list was created. This function should return GL_TRUE if it is called after the line:
It does not. I have used basically the same code in a non-cocoa context with success. The major difference between that code and this is the objective-C environment and the way in which the view was initiated. Here, I initiated the view with the code:
inserted inside "initWithRect". Is there something about my initialization that does not enable display lists to be made?
Code:
GLuint theCube;
theCube = glGenLists(1);
glNewList(theCube, GL_COMPILE);
(more code)
glEndList();
I have inserted code with the function "glIsList()" to test whether the list was created. This function should return GL_TRUE if it is called after the line:
Code:
theCube = glGenLists(1);
It does not. I have used basically the same code in a non-cocoa context with success. The major difference between that code and this is the objective-C environment and the way in which the view was initiated. Here, I initiated the view with the code:
Code:
NSOpenGLPixelFormatAttribute attrs[] = {
NSOpenGLPFAAccelerated,
NSOpenGLPFADepthSize, 16, 0
};
NSOpenGLPixelFormat* pixFmt = [[[NSOpenGLPixelFormat alloc] initWithAttributes: attrs] autorelease];
self = [super initWithFrame: frameRect pixelFormat: pixFmt];
return self;
inserted inside "initWithRect". Is there something about my initialization that does not enable display lists to be made?