blob: 60751ff34cba4c7121e1d98825dd8d979be4dec9 (
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
32
33
34
35
36
37
38
39
40
41
42
43
|
#import "iosOGLContextFactory.h"
iosOGLContextFactory::iosOGLContextFactory(CAEAGLLayer * layer)
: m_layer(layer)
, m_drawContext(NULL)
, m_uploadContext(NULL)
{}
iosOGLContextFactory::~iosOGLContextFactory()
{
delete m_drawContext;
delete m_uploadContext;
}
dp::OGLContext * iosOGLContextFactory::getDrawContext()
{
if (m_drawContext == NULL)
m_drawContext = new iosOGLContext(m_layer, m_uploadContext, true);
return m_drawContext;
}
dp::OGLContext * iosOGLContextFactory::getResourcesUploadContext()
{
if (m_uploadContext == NULL)
m_uploadContext = new iosOGLContext(m_layer, m_drawContext, false);
return m_uploadContext;
}
bool iosOGLContextFactory::isDrawContextCreated() const
{
return m_drawContext != nullptr;
}
bool iosOGLContextFactory::isUploadContextCreated() const
{
return m_uploadContext != nullptr;
}
void iosOGLContextFactory::setPresentAvailable(bool available)
{
if (m_drawContext != nullptr)
m_drawContext->setPresentAvailable(available);
}
|