OpenGL and GLUT on MacOSX

Posts: 1
Joined: 2008.09
Post: #1
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
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Dealing with GLUT and OpenGL... RingoEST 10 8,538 Aug 16, 2008 12:24 AM
Last Post: RingoEST
  Xcode OpenGL GLUT help please! cloudcrono 11 11,895 Sep 23, 2006 04:58 PM
Last Post: jpalm
  OpenGL Setup Without GLUT Justin Brimm 3 4,758 Jan 25, 2004 11:44 PM
Last Post: skyhawk
  Which dylib in OpenGL framework gets linked? (simple glut ex) johnMG 6 5,509 Oct 22, 2003 06:06 AM
Last Post: anarchie