title: OpenGL 3.2 w/ NSOpenGLView
body: <p>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?</p>
  
  <p>So far I have this code:</p>
  
  <pre><code>// Header File
  #import &lt;Cocoa/Cocoa.h&gt;
  
  @interface TCUOpenGLView : NSOpenGLView
  
  @end
  
  // Source File
  #import "TCUOpenGLView.h"
  #import &lt;OpenGL/gl.h&gt;
  
  @implementation TCUOpenGLView
  
  - (void)drawRect:(NSRect)dirtyRect {
      glClear(GL_COLOR_BUFFER_BIT);
      glFlush();
  }
  
  @end
  </code></pre>