mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-29 00:10:02 -05:00
Added Plugin support (#102)
* Build refactoring and initial plugin support * Possibly fixed linux / mac build * Added libdl to libglad build script * Add glfw to imgui dependencies * Refactored common functionality into "libimhex" for plugins * Added plugin loading and example plugin * Added proper API for creating a custom view and a custom tools entry with plugins
This commit is contained in:
33
plugins/example/source/plugin_example.cpp
Normal file
33
plugins/example/source/plugin_example.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <hex.hpp>
|
||||
|
||||
#include <views/view.hpp>
|
||||
#include <imgui.h>
|
||||
|
||||
class ViewExample : public hex::View {
|
||||
public:
|
||||
ViewExample() : hex::View("Example") {}
|
||||
~ViewExample() override {}
|
||||
|
||||
void drawContent() override {
|
||||
if (ImGui::Begin("Example")) {
|
||||
ImGui::Text("Custom plugin window");
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
};
|
||||
|
||||
IMHEX_PLUGIN {
|
||||
|
||||
View* createView() {
|
||||
return new ViewExample();
|
||||
}
|
||||
|
||||
void drawToolsEntry() {
|
||||
if (ImGui::CollapsingHeader("Example Tool")) {
|
||||
ImGui::Text("Custom Plugin tool");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user