Quick Start#
Build your first Xenon plugin in under 5 minutes.
Step 1: Create the Plugin File#
Create a file called my_plugin.cpp in the plugin-sdk/examples/ directory (or anywhere you like):
#include <xenon/SDK.hpp>
using namespace xenon;
// Define plugin metadata
XENON_PLUGIN_INFO(
"my_plugin",
"My First Plugin",
"YourName",
"Hello world plugin",
"1.0",
0,
PluginFlags::HasOverlay | PluginFlags::HasMenu
)
// Called once when the plugin loads
extern "C" void on_load()
{
Log("My plugin loaded!");
}
// Called every render frame — draw things here
extern "C" void on_render()
{
Draw::Text(100, 100, Color::Green(), "Hello from my plugin!");
}
// Called when the menu is open — add UI here
extern "C" void on_menu()
{
if (ImGui::CollapsingHeader("My Plugin"))
{
ImGui::Text("It works!");
}
}
Step 2: Build#
Open a terminal in the plugin-sdk/ directory and run:
If successful, you'll see:
Step 3: Load#
Copy output/my_plugin.wasm into Xenon's plugin directory and it will be loaded automatically.
What Just Happened?#
-
XENON_PLUGIN_INFOdefined anon_get_infofunction that tells Xenon your plugin's name, author, and capabilities. -
on_loadran once when the plugin was loaded. Good place for initialization and loading config. -
on_renderis called every frame during the render phase. Anything you draw here appears as an overlay. -
on_menuis called when the Xenon menu is open. Your ImGui widgets appear in the plugin's settings panel.
Next Steps#
- Learn about all entry points
- Add drawing to your overlay
- Create menus with ImGui
- Save settings with config
- Browse the full API reference