Add RmlUi

This commit is contained in:
Zero
2026-06-10 16:12:51 +02:00
parent b1d5ea2253
commit d2b7ff5f43
1255 changed files with 270119 additions and 1362 deletions

View File

@@ -0,0 +1,71 @@
#include "../../Include/RmlUi/Debugger/Debugger.h"
#include "../../Include/RmlUi/Core/Core.h"
#include "DebuggerPlugin.h"
namespace Rml {
namespace Debugger {
bool Initialise(Context* context)
{
if (DebuggerPlugin::GetInstance() != nullptr)
{
Log::Message(Log::LT_WARNING, "Unable to initialise debugger plugin, already initialised!");
return false;
}
DebuggerPlugin* plugin = new DebuggerPlugin();
if (!plugin->Initialise(context))
{
Log::Message(Log::LT_WARNING, "Unable to initialise debugger plugin.");
delete plugin;
return false;
}
SetContext(context);
RegisterPlugin(plugin);
return true;
}
void Shutdown()
{
DebuggerPlugin* plugin = DebuggerPlugin::GetInstance();
if (!plugin)
{
Log::Message(Log::LT_WARNING, "Unable to shutdown debugger plugin, it was not initialised!");
return;
}
UnregisterPlugin(plugin);
}
bool SetContext(Context* context)
{
DebuggerPlugin* plugin = DebuggerPlugin::GetInstance();
if (plugin == nullptr)
return false;
plugin->SetContext(context);
return true;
}
void SetVisible(bool visibility)
{
DebuggerPlugin* plugin = DebuggerPlugin::GetInstance();
if (plugin != nullptr)
plugin->SetVisible(visibility);
}
bool IsVisible()
{
DebuggerPlugin* plugin = DebuggerPlugin::GetInstance();
if (plugin == nullptr)
return false;
return plugin->IsVisible();
}
} // namespace Debugger
} // namespace Rml