OpenGL 3.2 w/ NSOpenGLView

Viewed 5647

How would I create a core profile in a custom implementation of NSOpenGLView? Which method should I override and what code should I put there?

So far I have this code:

// Header File
#import <Cocoa/Cocoa.h>

@interface TCUOpenGLView : NSOpenGLView

@end

// Source File
#import "TCUOpenGLView.h"
#import <OpenGL/gl.h>

@implementation TCUOpenGLView

- (void)drawRect:(NSRect)dirtyRect {
    glClear(GL_COLOR_BUFFER_BIT);
    glFlush();
}

@end
1 Answers
Related