1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow )
{
WNDCLASSEX Flag;
MSG userTemp;
memset(&userTemp,0,sizeof(userTemp));
Flag.lpszClassName = "The Flag Class";
Flag.cbSize = sizeof(WNDCLASSEX);
Flag.lpfnWndProc = WindowProc;
Flag.hCursor = LoadCursor(NULL, IDC_ARROW);
Flag.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
Flag.lpszMenuName = NULL;
Flag.cbClsExtra = 0;
Flag.cbWndExtra = 0;
if( !RegisterClassEx(&Flag) )
{
return E_FAIL;
}
hwnd = CreateWindowEx( NULL,"The Flag Class","07047878 Flag Simulation",WS_OVERLAPPEDWINDOW,0,0, 640,480, NULL, NULL, hinstance, NULL );
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
start();
shader();
while(userTemp.message != WM_QUIT)
{
if( PeekMessage(&userTemp, NULL, 0, 0, PM_REMOVE) )
{
TranslateMessage( &userTemp );
DispatchMessage( &userTemp );
}
else
{
timeCurrent = timeGetTime();
timeElapsed = (float)((timeCurrent - timeLast) * 0.001);
timeLast = timeCurrent;
renderFlag();
}
}
}
|