int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hWnd; if(GenerateWindow(_T("Fire_Balloon"), _T("Fire_Ballon Program"), 600, 700, hWnd) && InitializeInput()) { MSG msg; obj = new Main_Scene(); obj->Initialize(hWnd); obj->Draw(0.0f); while(true) { while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } if(msg.message == WM_QUIT) break; else { if(obj->GetSceneNumber() == obj->GAME_SCENE) { obj->Draw(0.0f, *user); } if (obj->GetGameState() && obj->GetSceneNumber() == obj->GAME_SCENE) { delete obj; obj = new GameResultScene(); obj->Initialize(hWnd); obj->Draw(0.0f, *user); } } } return msg.wParam; } UnregisterClass(_T("Fire_Balloon"), wcex.hInstance); delete obj; delete user; return 0; }
bool GenerateWindow(LPCWSTR className, LPCWSTR windowTitle, int width, int height, HWND& hWnd) { return GenerateWindow(className, windowTitle, (GetSystemMetrics(SM_CXSCREEN)-width)/2, (GetSystemMetrics(SM_CYSCREEN)-height)/2, width, height, hWnd); }
RectangularWindow::RectangularWindow(int length) { Initialize(length); GenerateWindow(length); return; }
void InitializeWindowAndInput(const char* windowTitle, int width, int height) { InitGlobalInput(); GenerateWindow(Input_WndProc, windowTitle, width, height); ActivateWindow(); }
DolphChebyWindow::DolphChebyWindow(int length, double atten) : GenericWindow(length) { double Alpha_Parm = cosh(acosh(pow(10.0, atten / 20.0)) / (length - 1)); GenerateWindow(length, Alpha_Parm); }
HammingWindow::HammingWindow(int num_taps) : GenericWindow(num_taps) { GenerateWindow(num_taps); }