Push before merge

This commit is contained in:
Ryzerth
2020-09-06 15:39:09 +02:00
parent 7190acfe9e
commit c0825dbeeb
35 changed files with 90 additions and 57 deletions

View File

@ -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

View File

@ -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) {
}