Edit AllPages

Can anyone help me turn this into objective c/cocoa? Thanks!

Yes, have a look at the NSOpenGLView documentation, copy one of the simple Apple sample code examples for NSOpenGLView and use your cut n paste function….

The draw_tiles function code should be placed in the drawRect method of your NSOpenGLView custom class.