summaryrefslogtreecommitdiff
path: root/plugintest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'plugintest.cc')
-rw-r--r--plugintest.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/plugintest.cc b/plugintest.cc
index 48dad58..a23c44b 100644
--- a/plugintest.cc
+++ b/plugintest.cc
@@ -173,6 +173,38 @@ void PluginTest::process(size_t pos,
}
}
+bool PluginTest::hasInlineGUI()
+{
+ return true;
+}
+
+void PluginTest::onInlineRedraw(std::size_t width,
+ std::size_t max_height,
+ InlineDrawContext& context)
+{
+ std::size_t height = std::min(width / 2, max_height);
+ if (!context.data || (context.width != width))
+ {
+ delete[] context.data;
+ context.data = new std::uint8_t[width * height * 4];
+ }
+
+ context.width = width;
+ context.height = height;
+
+ for(std::size_t x = 0; x < context.width; ++x)
+ {
+ for(std::size_t y = 0; y < context.height; ++y)
+ {
+ unsigned char* p = context.data + ((x + y * context.width) * 4);
+ p[0] = 0; // B;
+ p[1] = 0; // G
+ p[2] = 255; // R
+ p[3] = 0; // A
+ }
+ }
+}
+
bool PluginTest::hasGUI()
{
return true;