Advertisement

how do i use glutInit() inside Winmain()

Started by February 11, 2002 03:43 AM
1 comment, last by grafix 23 years ago
glutInit() takes two arguments int argc , char** argv if i''m makin a win32 console application - its fine but if i make a win32 application how do i initialise GLUT using glutInit() ?????????? Help me out !!!!!
Make your own parameters, and pass then to glutInit().
  char *argv[] = {"foo", "bar"};char argc = 2; // must/should match the number of strings in argvglutInit(&argc, argv);  


Remember that GLUT assumes argv[0] contains the name of the application (the filename to be correct). This does not have to match the actual name of the executable, but just make sure you DO have something in the first string, cause I believe GLUT will try to read it.
Advertisement
This glut tutorial explains how to create a Win32 GUI application in VC++ that uses main() instead of WinMain().

In addition, you can try the global __argc and __argv (stdlib.h I think). I can''t find anything about these in the docs, so I''d avoid them, but I guess they''re OK for little test projects.

This topic is closed to new replies.

Advertisement