vstdio / ood

Репозиторий для лабораторных работ по дисциплине "Объектно-ориентированное проектирование"
MIT License
0 stars 0 forks source link

Замечания по реализации паттерна Фабрика #5

Open alexey-malov opened 6 years ago

alexey-malov commented 6 years ago
alexey-malov commented 6 years ago
    auto r = GetClientRect(hWnd, &rect);
    assert(r == TRUE);
alexey-malov commented 6 years ago
alexey-malov commented 6 years ago
alexey-malov commented 6 years ago
    ::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
    auto hr = m_pFactory.CoCreateInstance(__uuidof(ID2D1Factory));
    assert(hr != S_FALSE); // Не возвращает S_OK

    hr = m_pRenderTarget.CoCreateInstance(__uuidof(ID2D1HwndRenderTarget));
    assert(hr != S_FALSE);

    hr = m_pBrush.CoCreateInstance(__uuidof(ID2D1SolidColorBrush));
    assert(hr != S_FALSE);

    hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &m_pFactory);
    assert(hr == S_OK);
alexey-malov commented 6 years ago
D2DCanvas::~D2DCanvas()
{
    ::CoUninitialize();
}
alexey-malov commented 6 years ago