iDevGames Forums
OpenGL and GLUT on MacOSX - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: OpenGL and GLUT on MacOSX (/thread-2392.html)

OpenGL and GLUT on MacOSX - Salvietta - Sep 19, 2008 05:34 AM

I'm developing a plug-in for an existing application using a developer kit specific for this application...I can add command and I'm trying to make this...specially a viewer able to show an image using OpenGL and GLUT...
This is the simple code use to initialize and install this viewer:

glutInit (NULL, NULL);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (800, 600);
gViewerWind = glutCreateWindow ("Viewer");

DoViewer_Init ();

glutReshapeFunc (DoViewer_Reshape);
glutDisplayFunc (DoViewer_Display);
glutKeyboardFunc (DoViewer_Key);
glutSpecialFunc (DoViewer_Special);
glutMouseFunc (DoViewer_Mouse);

glutMainLoop ();

I have no way to retrive data for <argc> and <argv> arguments necessary to glutInit so I use NULL for both...Everything seems to be right...I can see this because the main application lose focus after executing the glutMainLoop instruction...but unfortunately Sad I'm not able to see the window created using the glutCreateWindow instruction...
In all examples I have found usually the above code is called inside the <main> function so the question is...can I do the same thing from a running application like I'm trying?

Thank you for any type of help you can give me

OpenGL and GLUT on MacOSX - OneSadCookie - Sep 19, 2008 12:03 PM

I really wouldn't expect that to work. Find out if the app you're plugging into is Carbon or Cocoa, and create a window and GL context of the appropriate kind yourself, would be my advice. Even then, there's a potential for issues if the app you're plugging into does something weird with event dispatch.