Exemplo n.º 1
0
bool AudioClass::Initialize(HWND hwnd)
{
	FMOD_RESULT result;
	result = FMOD::System_Create(&m_system);
	ERRCHECK(result);

	result = m_system->init(MAX_CHANNEL_NUM, FMOD_INIT_NORMAL, 0);
	ERRCHECK(result);

	InitializeResource();

	m_bgmChannel = 0;
	return true;
}
Exemplo n.º 2
0
bool GameRoot::init()
{
    bool bRet = false;
    do {
        InitializeResource();
        _actorArrL = CCArray::create();
        _actorArrL->retain();
        _actorArrR = CCArray::create();
        _actorArrR->retain();
        _spriteTag = 0;
        bRet = true;
    } while (0);
    return bRet;
}
Exemplo n.º 3
0
int WINAPI WinMain(          HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow
)
{
    GameEngine engine;
    InitializeWindow(&engine);
    InitializeEngine(&engine);
    InitializeResource();

    if (engine.Initialize())
    {
        g_hWnd = engine.GethWnd();
        game->Start();
        engine.Start();
    }
    else
    {
        MessageBox(NULL, "´´½¨´°¿Úʧ°Ü", NULL, MB_OK);
    }

    return 0;
}
Exemplo n.º 4
0
/// <summary>
/// Handle windows messages for a class instance
/// </summary>
/// <param name="hWnd">Window message is for</param>
/// <param name="uMsg">Message</param>
/// <param name="wParam">Message data</param>
/// <param name="lParam">Additional message data</param>
/// <returns>result of message processing</returns>
LRESULT CMainWindow::DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {
    case WM_INITDIALOG:
        {
            // Bind application window handle
            m_hWnd = hWnd;

            // Set device status callback to monitor all sensor changes
            NuiSetDeviceStatusCallback(StatusChangeCallback, reinterpret_cast<void*>(hWnd));

            InitializeResource();
        }
        break;

    case WM_CTLCOLORSTATIC:
    case WM_CTLCOLORDLG:
        return (LRESULT)GetStockObject(WHITE_BRUSH);

    case WM_NOTIFY:
        switch (LOWORD(wParam))
        {
        case IDC_MOREINFOLINK:
            OnClickMoreInfoLink(lParam);
            break;

        case IDC_KINECTSENSORLIST:
            return m_pSensorListControl->HandleNotifyMessage(hWnd, (LPNMLISTVIEW)lParam);

        case IDC_STATUSLOGLIST:
            return m_pStatusLogListControl->HandleNotifyMessage(hWnd, (LPNMLISTVIEW)lParam);
        }
        break;

        // If the titlebar X is clicked, destroy the app
    case WM_CLOSE:
        {
            m_pKinectWindowMgr->CloseAllKinectWindows();
            DestroyWindow(hWnd);
        }
        break;

        // Quit the main message pump
    case WM_DESTROY:
        PostQuitMessage(0);
        break;

        // Handle the Kinect sensor status change case
    case WM_UPDATEMAINWINDOW:
        {
            UpdateMainWindow((PCWCHAR)wParam, (HRESULT)lParam);
            UpdateLayoutAndShowStatus();
        }
        break;

        // If the kinect window is closed, notify Kinect window manager
    case WM_CLOSEKINECTWINDOW:
        m_pKinectWindowMgr->ResetKinectWindow((PCWSTR)wParam);
        break;

    case WM_SIZE:
        Resize();
        break;

    case WM_PAINT:
        DrawBreakLine();
        break;

    case WM_GETMINMAXINFO:
        {
            POINT minTrackSize = {m_minTrackWidth, 0};

            auto pMinMaxInfo = (PMINMAXINFO)lParam;
            pMinMaxInfo->ptMinTrackSize = minTrackSize;
        }
        break;
    }

    return FALSE;
}