Skip to content

Commit

Permalink
Keep linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Nov 28, 2022
1 parent b6edd6d commit a73c0e3
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions DebugGUI/src/DebugGUIMacos.mm
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,19 @@ static void default_error_callback(int error, const char *description) {
if (error_callback == nullptr) {
glfwSetErrorCallback(default_error_callback);
}
if (!glfwInit()) return nullptr;
if (!glfwInit()) {
return nullptr;
}
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
context = (DebugGUIContext *)(malloc(sizeof(DebugGUIContext)));
window = glfwCreateWindow(1280, 720, name, nullptr, nullptr);

if (window == NULL) return 0;
if (window == nullptr) {
return nullptr;
}

context->window = window;
context->device = MTLCreateSystemDefaultDevice();
;
context->commandQueue = [context->device newCommandQueue];

// Setup Platform/Renderer backends
Expand All @@ -77,11 +80,12 @@ static void default_error_callback(int error, const char *description) {
icons_config.FontDataOwnedByAtlas = false;
icons_config.GlyphOffset = {0, 2};
icons_config.GlyphMinAdvanceX = 17;
io.Fonts->AddFontFromMemoryTTF((void *)s_iconsFontAwesomeTtf,
sizeof(s_iconsFontAwesomeTtf), 13.0f,
&icons_config, icons_ranges);
io.Fonts->AddFontFromMemoryTTF((void *)s_iconsFontAwesomeTtf, sizeof(s_iconsFontAwesomeTtf),
13.0f, &icons_config, icons_ranges);

if (io.Fonts->ConfigData.empty()) io.Fonts->AddFontDefault();
if (io.Fonts->ConfigData.empty()) {
io.Fonts->AddFontDefault();
}
// io.Fonts->Build();
io.DisplaySize = ImVec2(1280, 720);
ImGui_ImplMetal_Init(context->device);
Expand Down Expand Up @@ -129,11 +133,12 @@ static void default_error_callback(int error, const char *description) {
icons_config.GlyphOffset = {0, 2};
icons_config.GlyphMinAdvanceX = 17;
icons_config.FontDataOwnedByAtlas = false;
io.Fonts->AddFontFromMemoryTTF((void *)s_iconsFontAwesomeTtf,
sizeof(s_iconsFontAwesomeTtf), 13.0f,
&icons_config, icons_ranges);
io.Fonts->AddFontFromMemoryTTF((void *)s_iconsFontAwesomeTtf, sizeof(s_iconsFontAwesomeTtf),
13.0f, &icons_config, icons_ranges);

if (io.Fonts->ConfigData.empty()) io.Fonts->AddFontDefault();
if (io.Fonts->ConfigData.empty()) {
io.Fonts->AddFontDefault();
}
// io.Fonts->Build();
io.DisplaySize = ImVec2(1280, 720);
ImGui_ImplMetal_Init(device);
Expand All @@ -154,7 +159,7 @@ bool pollGUIPreRender(void *context, float delta) {
return true;
}

DebugGUIContext *ctx = reinterpret_cast<DebugGUIContext *>(context);
auto *ctx = reinterpret_cast<DebugGUIContext *>(context);
NSWindow *nswin = glfwGetCocoaWindow(ctx->window);
if (glfwWindowShouldClose(ctx->window)) {
return false;
Expand Down Expand Up @@ -186,7 +191,7 @@ void pollGUIPostRender(void *context, void *drawData) {
if (!context) {
return;
}
DebugGUIContext *ctx = reinterpret_cast<DebugGUIContext *>(context);
auto *ctx = reinterpret_cast<DebugGUIContext *>(context);
@autoreleasepool {
auto drawable = [layer nextDrawable];

Expand Down

0 comments on commit a73c0e3

Please sign in to comment.