mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-25 12:07:49 +02:00
new modole system
This commit is contained in:
7
demo/CMakeLists.txt
Normal file
7
demo/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(demo)
|
||||
|
||||
file(GLOB SRC "src/*.cpp")
|
||||
|
||||
add_library(demo SHARED ${SRC})
|
||||
target_link_libraries(demo PRIVATE sdrpp_core)
|
38
demo/src/main.cpp
Normal file
38
demo/src/main.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
#include <imgui.h>
|
||||
#include <module.h>
|
||||
#include <watcher.h>
|
||||
#include <dsp/types.h>
|
||||
#include <dsp/stream.h>
|
||||
#include <thread>
|
||||
#include <ctime>
|
||||
#include <stdio.h>
|
||||
#include <style.h>
|
||||
|
||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||
|
||||
|
||||
struct DemoContext_t {
|
||||
std::string name;
|
||||
};
|
||||
|
||||
MOD_EXPORT void* _INIT_(mod::API_t* _API, ImGuiContext* imctx, std::string _name) {
|
||||
DemoContext_t* ctx = new DemoContext_t;
|
||||
ctx->name = _name;
|
||||
return ctx;
|
||||
}
|
||||
|
||||
MOD_EXPORT void _NEW_FRAME_(DemoContext_t* ctx) {
|
||||
|
||||
}
|
||||
|
||||
MOD_EXPORT void _DRAW_MENU_(DemoContext_t* ctx) {
|
||||
ImGui::Text(ctx->name.c_str());
|
||||
}
|
||||
|
||||
MOD_EXPORT void _HANDLE_EVENT_(DemoContext_t* ctx, int eventId) {
|
||||
|
||||
}
|
||||
|
||||
MOD_EXPORT void _STOP_(DemoContext_t* ctx) {
|
||||
|
||||
}
|
Reference in New Issue
Block a user