>>96103161
Your teacher is retarded.
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
char cwd[MAX_OSPATH];
int startTime, endTime;
if ( hPrevInstance ) {
return 0;
}
g_wv.hInstance = hInstance;
Q_strncpyz( sys_cmdline, lpCmdLine, sizeof( sys_cmdline ) );
Sys_CreateConsole();
SetErrorMode( SEM_FAILCRITICALERRORS );
Sys_Milliseconds();
Sys_InitStreamThread();
Com_Init( sys_cmdline );
NET_Init();
_getcwd (cwd, sizeof(cwd));
Com_Printf("Working directory: %s\n", cwd);
if ( !com_dedicated->integer && !com_viewlog->integer ) {
Sys_ShowConsole( 0, qfalse );
}
while( 1 ) {
if ( g_wv.isMinimized || ( com_dedicated && com_dedicated->integer ) ) {
Sleep( 5 );
}
startTime = Sys_Milliseconds();
IN_Frame();
Com_Frame();
endTime = Sys_Milliseconds();
totalMsec += endTime - startTime;
countMsec++;
}
}
This is the literal main function of Quake III.