mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-08 18:15:21 +02:00
Push before merge
This commit is contained in:
@ -30,7 +30,7 @@ include_directories(demo "../../src/imgui")
|
||||
file(GLOB SRC "src/*.cpp")
|
||||
file(GLOB IMGUI "../../src/imgui/*.cpp")
|
||||
add_library(demo SHARED ${SRC} ${IMGUI})
|
||||
set_target_properties(demo PROPERTIES OUTPUT_NAME demo)
|
||||
set_target_properties(demo PROPERTIES PREFIX "")
|
||||
|
||||
if (MSVC)
|
||||
# Glew
|
||||
|
@ -1,26 +1,38 @@
|
||||
#include <imgui.h>
|
||||
#include <module.h>
|
||||
#include <watcher.h>
|
||||
#include <wav.h>
|
||||
#include <dsp/types.h>
|
||||
#include <dsp/stream.h>
|
||||
#include <thread>
|
||||
#include <ctime>
|
||||
|
||||
mod::API_t* API;
|
||||
|
||||
struct DemoContext_t {
|
||||
struct ExampleContext_t {
|
||||
std::string name;
|
||||
};
|
||||
|
||||
MOD_EXPORT void* _INIT_(mod::API_t* _API, ImGuiContext* imctx, std::string _name) {
|
||||
API = _API;
|
||||
DemoContext_t* ctx = new DemoContext_t;
|
||||
ExampleContext_t* ctx = new ExampleContext_t;
|
||||
ctx->name = _name;
|
||||
ImGui::SetCurrentContext(imctx);
|
||||
return ctx;
|
||||
}
|
||||
|
||||
MOD_EXPORT void _DRAW_MENU_(DemoContext_t* ctx) {
|
||||
char buf[100];
|
||||
sprintf(buf, "I'm %s", ctx->name.c_str());
|
||||
ImGui::Button(buf);
|
||||
MOD_EXPORT void _NEW_FRAME_(ExampleContext_t* ctx) {
|
||||
|
||||
}
|
||||
|
||||
MOD_EXPORT void _STOP_(DemoContext_t* ctx) {
|
||||
delete ctx;
|
||||
MOD_EXPORT void _DRAW_MENU_(ExampleContext_t* ctx) {
|
||||
ImGui::Text("Demo!");
|
||||
}
|
||||
|
||||
MOD_EXPORT void _HANDLE_EVENT_(ExampleContext_t* ctx, int eventId) {
|
||||
|
||||
}
|
||||
|
||||
MOD_EXPORT void _STOP_(ExampleContext_t* ctx) {
|
||||
|
||||
}
|
Reference in New Issue
Block a user