blob: 71b9da7a794e27df84f77e38760bf6ae92c5d094 (
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(nullptr)
, m_uploadContext(nullptr)
{}
QtOGLContextFactory::~QtOGLContextFactory()
{
delete m_drawContext;
delete m_uploadContext;
}
dp::OGLContext * QtOGLContextFactory::getDrawContext()
{
if (m_drawContext == nullptr)
m_drawContext = new QtOGLContext(m_surface, m_uploadContext);
return m_drawContext;
}
dp::OGLContext * QtOGLContextFactory::getResourcesUploadContext()
{
if (m_uploadContext == nullptr)
m_uploadContext = new QtOGLContext(m_surface, m_drawContext);
return m_uploadContext;
}
|