blob: 501f3c3ccf4ccdebf0e693a69ecf9cf42cdb5cfa (
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
|
#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;
}
|