示例#1
0
IRCChannelPage::~IRCChannelPage()
{
	cleanupWindow();	
}
示例#2
0
ExtensionsWizardPageGeneral::~ExtensionsWizardPageGeneral()
{
	cleanupWindow();
}
示例#3
0
IRCConfigWindow::~IRCConfigWindow()
{
	cleanupWindow();
}
示例#4
0
LogWindow::~LogWindow()
{
	cleanupWindow();
}
示例#5
0
文件: main.cpp 项目: Potion/pocode
int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst, LPSTR lpszCmdLine, int nCmdShow) {

	openConsoleWindow();

	HINSTANCE hinst = hCurrentInst;  
	registerWindowsClass(hinst);
	setupApplication();

	double avg_frame_time = 0.0;
	double next_frame_time=-1.0, last_frame_time=0.0;
	int frame_num = 0;

	::ShowWindow( hwnd, SW_SHOW );
	::SetForegroundWindow( hwnd );
	::SetFocus( hwnd );

	// do the draw/update/event loop
	MSG msg;
	bool quit = false;
	while(!quit) {
		if( ::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) {
			if(msg.message == WM_QUIT) {
				cleanupApplication();

				poWindow *win = (poWindow*)GetWindowLongPtr(hwnd,GWL_USERDATA);
				delete win;

				cleanupWindow();
				break;
			}

			::TranslateMessage( &msg );
			::DispatchMessage( &msg ); 
		}

		double now = getTiming();
		if(now >= next_frame_time) {
			next_frame_time = now + 1.0 / 60.0;
			double dt = now - last_frame_time;

			poWindow *win = (poWindow*)GetWindowLongPtr(hwnd,GWL_USERDATA);
			if(win) {
				win->makeCurrent();
				win->update();
				win->draw();
			}

			SwapBuffers(dc);

			frame_num++;
			last_frame_time = now;
		}
		else {
			Sleep(1);
		}
	}

	cleanupWindow();
	
	#if defined WIN32 && defined _DEBUG
		//_CrtDumpMemoryLeaks();
	#endif	

	return msg.wParam;
}