Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Odjaahla

macrumors newbie
Original poster
Feb 26, 2011
1
0
Hi,

I recently bought myself a mac and I would like to port some C++ OpenGL programming projects from Windows. On Windows I had a class that initialized an OpenGL window and provided functions to draw pixelated graphics, draw graphs and so on. For example:

Code:
//compute some array x here....
MyGLWindow* win = new MyGLWindow(640,480,"MyGraph");
win->drawgraph(x);
//compute another array y here...
win->addgraph(y);

Writing such a class in C++ on Windows was pretty much a breeze. Not so on the mac as far as I can see. After numerous web searches it seems that the two most common OpenGL approaches are

-glut, which is no good for my purposes, since I don't want to get stuck in glutMainLoop
-cocoa, which seems to fail by the same reason. In all sample programs/tutorials I've seen there is the initial call to NSApplicationMain and/or one sets the window properties in xcode.

I assume that it is possible to do what I want, but how much of a pain is it going to be? Are there any tutorial/code snippets out there?
 
I'm not an expert at OpenGL by any means but have you considered using SDL or SFML? I don't believe that those two need an event loop for just using their OpenGL interfaces.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.