Welcome to mirror list, hosted at ThFree Co, Russian Federation.

qtoglcontextfactory.cpp « qt - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 21f0224f2e0fdbd83ebd55d7b7a09b99b2e64855 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "qt/qtoglcontextfactory.hpp"

#include "base/assert.hpp"

QtOGLContextFactory::QtOGLContextFactory(QWindow * surface)
  : m_surface(surface)
  , m_drawContext(NULL)
  , m_uploadContext(NULL)
{}

QtOGLContextFactory::~QtOGLContextFactory()
{
  delete m_drawContext;
  delete m_uploadContext;
}

dp::OGLContext * QtOGLContextFactory::getDrawContext()
{
  if (m_drawContext == NULL)
    m_drawContext = new QtOGLContext(m_surface, m_uploadContext);

  return m_drawContext;
}

dp::OGLContext * QtOGLContextFactory::getResourcesUploadContext()
{
  if (m_uploadContext == NULL)
    m_uploadContext = new QtOGLContext(m_surface, m_drawContext);

  return m_uploadContext;
}