PDA

View Full Version : GLUT in Win32 application



05-07-2001, 08:45 AM
Hello,
I am trying to make glut work in win32 app (not console). In win32 app, i use the WinMain function instead of main. I use the standard WinMain function. My code is this:

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
glutInit(0, NULL);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(400,400);
glutInitWindowPosition(200, 200);
glutCreateWindow("Actual window");

init();
glutDisplayFunc(display);
glutMainLoop();

return 0;
}

the problem is that the app runs, but makes an error, and forces the user to close it. u know the window. U can try it too to tell me if it works, but please help me a bit. also, what is the argc and argv values? do the vary?

Boresight
05-07-2001, 10:11 AM
argv is a array that contents the command line parameters and argc is the number of parameters. You must use thsese parameters in gluInit to work.

You can use bogoParameters for example:
char** argvbogo;
int argcbogo;
instead the real parameters.

05-07-2001, 10:58 AM
Hey, i deleted the glutInit function, and the program runs ok.. ? is the glutInit useful only for console apps?