I need to add more number of NSView along with more number of customised NSOpenGLView in a window and then wants to shuffle the array of views. If I set the base view setWantsLayer:YES initially, I can't draw the OpenGLView if I set setWantsLayer:NO, I can draw OpenGLView but the NSView are goes beyond the OpenGLView. Like,
In MyOpenGLView.m
myOpenGLView = [ [ MyOpenGLView alloc ] initWithFrame:frame_ colorBits:16 depthBits:16 fullscreen:FALSE ];
[self addSubview: myOpenGLView];
Then I try to add one more view on window
customView = [[CustomView alloc] initWithFrame:[self bounds]];
[self addSubview:customView];
Now my custom View goes beyond the myOpenGLView. How do I fix this?
Edit:
Screenshot of Problem