| 403 | } |
| 404 | |
| 405 | void drawBody() |
| 406 | { |
| 407 | const PluginDynamicLibrary& library = system.registry.getPluginDynamicLibraryAt(viewState.page); |
| 408 | |
| 409 | ISCExample* example = nullptr; |
| 410 | if (library.queryInterface(example)) |
| 411 | { |
| 412 | example->onDraw(); |
| 413 | } |
| 414 | else if (not library.lastErrorLog.isEmpty()) |
| 415 | { |
| 416 | SmallString<256> pluginUTF8 = StringEncoding::Utf8; |
| 417 | (void)StringConverter::appendEncodingTo(StringEncoding::Utf8, library.definition.identity.name.view(), |
| 418 | pluginUTF8, StringConverter::NullTerminate); |
| 419 | ImGui::Text("Example %s failed to compile:", pluginUTF8.view().bytesIncludingTerminator()); |
| 420 | ImGui::PushStyleColor(ImGuiCol_Text, 0xff0000ff); |
| 421 | ImGui::Text("%s", library.lastErrorLog.bytesIncludingTerminator()); |
| 422 | ImGui::PopStyleColor(); |
| 423 | } |
| 424 | } |
| 425 | }; |
| 426 | |
| 427 | } // namespace SC |
no test coverage detected