That under the Windows, if process input option parameters
CodePudding user response:
Direct analysis such as:
GLenum Args (int arg c, char * * argv)
{
The GLint I;
DoubleBuffer=GL_FALSE;
For (I=1; i{
If (STRCMP (argv [I], "sb")==0)
{
DoubleBuffer=GL_FALSE;
}
Else if (STRCMP (argv [I], "- db")==0)
{
DoubleBuffer=GL_TRUE;
}
Else if (STRCMP (argv [I], "-f")==0)
{
If (I + 1 & gt; + 1=arg c | | argv [I] [0]=='-')
{
//printf (" -f (No file name). \ n ");
Return GL_FALSE;
}
The else
{
FileName=argv [+ + I];
}
}
The else
{
//printf (" % s (Bad option). \ n ", argv [I]);
Return GL_FALSE;
}
}
Return GL_TRUE;
}
Void main (int arg c, char * * argv)
{
GLenum type;
If (Args (arg c, argv)==GL_FALSE)
{
AuxQuit ();
}
CodePudding user response:
__argc and __targv#include
#include
for(int i=0; i<__argc; I++)
{
TRACE (_T (" argv [% d]==% s \ n "), I, __targv [I]);
}