blob: 33ad81691a4f10da1079ac7b5e707a2b7238a9b0 (
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 "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;
}
|