Sign in to follow this  
Salvietta

OpenGL and GLUT on MacOSX

Recommended Posts

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 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

Share this post


Link to post
Share on other sites
I've checked and I can say nothing relevant logged in the console logs when starting the application. Inside documentation related to application I'm not able to find out something that can help me and inside the Development Kit I'm using there are no methods useful in this sense....

Share this post


Link to post
Share on other sites
When running your application, the arguments in argv are the command line parameters you used.
For instance: gdb myApp results in argc=2 and argv={"gdb","myApp"}. Usually glut wont need any other params then the first one, so just pass in you application name with argc=1.

Share this post


Link to post
Share on other sites
Thank you Caste. I've tried as you suggest me: inside the glutInit call I've put 1 parameter and the name of the application...The glutCreateWindow return as result 1 so window seems to be right but...as before calling glutMainLoop simply the main application lose the focus and my window doesn't appear...maybe is not due to the glutInit call...SIGH!!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this