mirror of https://github.com/AxioDL/boo.git
OS X fixes
This commit is contained in:
parent
9e1441c323
commit
742e062cf2
|
@ -162,6 +162,7 @@ class GraphicsContextCocoaGL : public GraphicsContextCocoa
|
|||
|
||||
IGraphicsCommandQueue* m_commandQueue = nullptr;
|
||||
IGraphicsDataFactory* m_dataFactory = nullptr;
|
||||
NSOpenGLContext* m_mainCtx = nullptr;
|
||||
NSOpenGLContext* m_loadCtx = nullptr;
|
||||
|
||||
public:
|
||||
|
@ -235,6 +236,20 @@ public:
|
|||
return m_dataFactory;
|
||||
}
|
||||
|
||||
IGraphicsDataFactory* getMainContextDataFactory()
|
||||
{
|
||||
if (!m_mainCtx)
|
||||
{
|
||||
NSOpenGLPixelFormat* nspf = [[NSOpenGLPixelFormat alloc] initWithAttributes:PF_TABLE[m_pf]];
|
||||
m_mainCtx = [[NSOpenGLContext alloc] initWithFormat:nspf shareContext:[m_nsContext openGLContext]];
|
||||
[nspf release];
|
||||
if (!m_mainCtx)
|
||||
Log.report(LogVisor::FatalError, "unable to make main NSOpenGLContext");
|
||||
[m_mainCtx makeCurrentContext];
|
||||
}
|
||||
return m_dataFactory;
|
||||
}
|
||||
|
||||
IGraphicsDataFactory* getLoadContextDataFactory()
|
||||
{
|
||||
if (!m_loadCtx)
|
||||
|
@ -1125,6 +1140,11 @@ public:
|
|||
return m_gfxCtx->getDataFactory();
|
||||
}
|
||||
|
||||
IGraphicsDataFactory* getMainContextDataFactory()
|
||||
{
|
||||
return m_gfxCtx->getMainContextDataFactory();
|
||||
}
|
||||
|
||||
IGraphicsDataFactory* getLoadContextDataFactory()
|
||||
{
|
||||
return m_gfxCtx->getLoadContextDataFactory();
|
||||
|
|
Loading…
Reference in New Issue