//==============================
//  SwipeHintComponent::OnEvent_Impl
eMsgStatus SwipeHintComponent::OnEvent_Impl( OvrGuiSys & guiSys, VrFrame const & vrFrame,
        VRMenuObject * self, VRMenuEvent const & event )
{
    switch( event.EventType )
    {
    	case VRMENU_EVENT_OPENING :
    		return Opening( guiSys, vrFrame, self, event );
        case VRMENU_EVENT_FRAME_UPDATE :
        	return Frame( guiSys, vrFrame, self, event );
        default:
            OVR_ASSERT( !"Event flags mismatch!" );
            return MSG_STATUS_ALIVE;
    }
}
Beispiel #2
0
bool CMain::GameLoop(){
	int dnum;

	StartDemo();

	if (PLAYDATA_NUM>0){
		CLoad PlayDataLoad;
			char path[256]; strcpy_s(path, "tenyu_data/save");
			PlayDataLoad.LoadPlayData(path, PlayData);
	}

	while(1){
		switch(Title()){
		case TITLE_FIRSTSTART:
			Opening();
			return Playing();

		case TITLE_LOADSTART:
			if (PLAYDATA_NUM>0 && (dnum = ChooseData()) != -1){
				return Playing(dnum);
			}
			break;

		case TITLE_SETTING:
			Setting();
			break;
		
		case TITLE_GAMEEND:
			return false;

		default:
			WarningDx("Warning->Unexpected matter happend [back to title]->GameLoop()", __FILE__, __LINE__);
		}
	}

	return true;
}
Beispiel #3
0
/// <summary>
/// Creates the main window and begins processing
/// </summary>
/// <param name="hInstance">handle to the application instance</param>
/// <param name="nCmdShow">whether to display minimized, maximized, or normally</param>
int CColorBasics::Run(HINSTANCE hInstance, int nCmdShow)
{
	if (m_pBackgroundRGBX)
	{
		//if (FAILED(LoadResourceImage(L"Background", L"Image", cDepthWidth, cDepthHeight, m_pBackgroundRGBX)))
		//if (FAILED(LoadResourceImage(MAKEINTRESOURCE(IDB_BITMAP1), RT_BITMAP, cDepthWidth, cDepthHeight, m_pBackgroundRGBX)))
		if (FAILED(LoadResourceImage(MAKEINTRESOURCE(IDB_PNG1), L"Png", cColorWidth, cColorHeight, m_pBackgroundRGBX)))
		{
			delete[] m_pBackgroundRGBX;
			m_pBackgroundRGBX = NULL;
		}
	}

	MSG       msg = { 0 };
	WNDCLASS  wc;

	// Dialog custom window class
	ZeroMemory(&wc, sizeof(wc));
	wc.style         = CS_HREDRAW | CS_VREDRAW;
	wc.cbWndExtra    = DLGWINDOWEXTRA;
	wc.hCursor       = LoadCursorW(NULL, IDC_ARROW);
	wc.hIcon         = LoadIconW(hInstance, MAKEINTRESOURCE(IDI_APP));
	wc.lpfnWndProc   = DefDlgProcW;
	wc.lpszClassName = L"ColorBasicsAppDlgWndClass";

	if (!RegisterClassW(&wc))
	{
		return 0;
	}

    // Create main application window
    HWND hWndApp = CreateDialogParamW(
        NULL,
        MAKEINTRESOURCE(IDD_APP),
        NULL,
        (DLGPROC)CColorBasics::MessageRouter, 
        reinterpret_cast<LPARAM>(this));

	// Show window
	ShowWindow(hWndApp, nCmdShow);

	// Timer
	SetTimer(hWndApp, IDT_KTIMER_1, 50, (TIMERPROC)NULL);

	// Main message loop
	while (WM_QUIT != msg.message)
	{
		// 2014/02/20 Wada カラーとボディを別々に描画させたら
		// やはり、ちらちらしてだめだった。FPSも落ちた。
		//UpdateBody();
		if (m_bOpening){ Opening(); }
		//else{ Update(); }

		while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
		{
			// If a dialog message will be taken care of by the dialog proc
			if (hWndApp && IsDialogMessageW(hWndApp, &msg))
			{
				continue;
			}

			TranslateMessage(&msg);
			DispatchMessageW(&msg);
		}
	}

	return static_cast<int>(msg.wParam);
}