Massive fmtlib refactor

This commit is contained in:
Jack Andersen
2019-07-19 18:22:36 -10:00
parent b2bf7549f5
commit deefc8e995
38 changed files with 364 additions and 400 deletions

View File

@@ -103,11 +103,11 @@ public:
m_metalCtx.m_dev = MTLCreateSystemDefaultDevice();
if (!m_metalCtx.m_dev)
Log.report(logvisor::Fatal, "Unable to create metal device");
Log.report(logvisor::Fatal, fmt("Unable to create metal device"));
m_metalCtx.m_q = [m_metalCtx.m_dev newCommandQueue];
while (![m_metalCtx.m_dev supportsTextureSampleCount:m_metalCtx.m_sampleCount])
m_metalCtx.m_sampleCount = flp2(m_metalCtx.m_sampleCount - 1);
Log.report(logvisor::Info, "using Metal renderer");
Log.report(logvisor::Info, fmt("using Metal renderer"));
}
EPlatformType getPlatformType() const {

View File

@@ -226,7 +226,7 @@ public:
~GraphicsContextCocoaGL()
{
m_commandQueue->stopRenderer();
printf("CONTEXT DESTROYED\n");
fmt::print(fmt("CONTEXT DESTROYED\n"));
}
void _setCallback(IWindowCallback* cb)
@@ -256,7 +256,7 @@ public:
{
m_nsContext = [[GraphicsContextCocoaGLInternal alloc] initWithBooContext:this];
if (!m_nsContext)
Log.report(logvisor::Fatal, "unable to make new NSOpenGLView");
Log.report(logvisor::Fatal, fmt("unable to make new NSOpenGLView"));
[(__bridge NSWindow*)(void*)m_parentWindow->getPlatformHandle() setContentView:m_nsContext];
CVDisplayLinkCreateWithActiveCGDisplays(&m_dispLink);
CVDisplayLinkSetOutputCallback(m_dispLink, (CVDisplayLinkOutputCallback)DLCallback, this);
@@ -292,7 +292,7 @@ public:
NSOpenGLPixelFormat* nspf = [[NSOpenGLPixelFormat alloc] initWithAttributes:PF_TABLE[int(m_pf)]];
m_mainCtx = [[NSOpenGLContext alloc] initWithFormat:nspf shareContext:[m_nsContext openGLContext]];
if (!m_mainCtx)
Log.report(logvisor::Fatal, "unable to make main NSOpenGLContext");
Log.report(logvisor::Fatal, fmt("unable to make main NSOpenGLContext"));
}
[m_mainCtx makeCurrentContext];
return m_dataFactory.get();
@@ -305,7 +305,7 @@ public:
NSOpenGLPixelFormat* nspf = [[NSOpenGLPixelFormat alloc] initWithAttributes:PF_TABLE[int(m_pf)]];
m_loadCtx = [[NSOpenGLContext alloc] initWithFormat:nspf shareContext:[m_nsContext openGLContext]];
if (!m_loadCtx)
Log.report(logvisor::Fatal, "unable to make load NSOpenGLContext");
Log.report(logvisor::Fatal, fmt("unable to make load NSOpenGLContext"));
}
[m_loadCtx makeCurrentContext];
return m_dataFactory.get();
@@ -349,7 +349,7 @@ IGraphicsContext* _GraphicsContextCocoaGLNew(IGraphicsContext::EGraphicsAPI api,
minor = glVersion[2] - '0';
}
if (glewInit() != GLEW_OK)
Log.report(logvisor::Fatal, "glewInit failed");
Log.report(logvisor::Fatal, fmt("glewInit failed"));
[NSOpenGLContext clearCurrentContext];
if (!glVersion)
return NULL;
@@ -412,7 +412,7 @@ public:
MetalContext::Window& w = m_metalCtx->m_windows[m_parentWindow];
m_nsContext = [[GraphicsContextCocoaMetalInternal alloc] initWithBooContext:this];
if (!m_nsContext)
Log.report(logvisor::Fatal, "unable to make new NSView for Metal");
Log.report(logvisor::Fatal, fmt("unable to make new NSView for Metal"));
w.m_metalLayer = (CAMetalLayer*) m_nsContext.layer;
[(__bridge NSWindow*) (void*) m_parentWindow->getPlatformHandle() setContentView:m_nsContext];
CVDisplayLinkCreateWithActiveCGDisplays(&m_dispLink);