aboutsummaryrefslogtreecommitdiff
path: root/demo/DemoApp/imguiGraphLoader.cpp
diff options
context:
space:
mode:
authorAndrew Reidmeyer <[email protected]>2017-03-15 09:28:59 -0600
committerAndrew Reidmeyer <[email protected]>2017-03-15 09:28:59 -0600
commitf5f6a899903a309f1fc93b31c0297fc7b3b5cf46 (patch)
treeed3dece338b579d5b51af494b2d543fb46c43fa3 /demo/DemoApp/imguiGraphLoader.cpp
downloadflow-1.0.0.tar.xz
flow-1.0.0.zip
Initial 1.0.0 binary releasev1.0.0
Diffstat (limited to 'demo/DemoApp/imguiGraphLoader.cpp')
-rw-r--r--demo/DemoApp/imguiGraphLoader.cpp125
1 files changed, 125 insertions, 0 deletions
diff --git a/demo/DemoApp/imguiGraphLoader.cpp b/demo/DemoApp/imguiGraphLoader.cpp
new file mode 100644
index 0000000..155e9f3
--- /dev/null
+++ b/demo/DemoApp/imguiGraphLoader.cpp
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+#include <SDL.h>
+
+#include "loader.h"
+
+#include "imguiGraph.h"
+#include "imguiInterop.h"
+
+namespace
+{
+ ModuleLoader<24u, SDL_LoadObject, SDL_UnloadObject, SDL_LoadFunction> g_loader;
+}
+
+void loadImgui(AppGraphCtxType type)
+{
+ const char* moduleName = demoAppDLLName(type);
+
+ g_loader.loadModule(moduleName);
+}
+
+void unloadImgui()
+{
+ g_loader.unloadModule();
+}
+
+// Below are the functions that must be implemented per graphics API
+
+void imguiGraphContextInit(const ImguiGraphDesc* desc)
+{
+ return g_loader.function<0>(imguiGraphContextInit, "imguiGraphContextInit", desc);
+}
+
+void imguiGraphContextUpdate(const ImguiGraphDesc* desc)
+{
+ return g_loader.function<1>(imguiGraphContextUpdate, "imguiGraphContextUpdate", desc);
+}
+
+void imguiGraphContextDestroy()
+{
+ return g_loader.function<2>(imguiGraphContextDestroy, "imguiGraphContextDestroy");
+}
+
+void imguiGraphRecordBegin()
+{
+ return g_loader.function<3>(imguiGraphRecordBegin, "imguiGraphRecordBegin");
+}
+
+void imguiGraphRecordEnd()
+{
+ return g_loader.function<4>(imguiGraphRecordEnd, "imguiGraphRecordEnd");
+}
+
+void imguiGraphVertex2f(float x, float y)
+{
+ return g_loader.function<5>(imguiGraphVertex2f, "imguiGraphVertex2f", x, y);
+}
+
+void imguiGraphVertex2fv(const float* v)
+{
+ return g_loader.function<6>(imguiGraphVertex2fv, "imguiGraphVertex2fv", v);
+}
+
+void imguiGraphTexCoord2f(float u, float v)
+{
+ return g_loader.function<7>(imguiGraphTexCoord2f, "imguiGraphTexCoord2f", u, v);
+}
+
+void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
+{
+ return g_loader.function<8>(imguiGraphColor4ub, "imguiGraphColor4ub", red, green, blue, alpha);
+}
+
+void imguiGraphColor4ubv(const uint8_t* v)
+{
+ return g_loader.function<9>(imguiGraphColor4ubv, "imguiGraphColor4ubv", v);
+}
+
+void imguiGraphFontTextureEnable()
+{
+ return g_loader.function<10>(imguiGraphFontTextureEnable, "imguiGraphFontTextureEnable");
+}
+
+void imguiGraphFontTextureDisable()
+{
+ return g_loader.function<11>(imguiGraphFontTextureDisable, "imguiGraphFontTextureDisable");
+}
+
+void imguiGraphEnableScissor(int x, int y, int width, int height)
+{
+ return g_loader.function<12>(imguiGraphEnableScissor, "imguiGraphEnableScissor", x, y, width, height);
+}
+
+void imguiGraphDisableScissor()
+{
+ return g_loader.function<13>(imguiGraphDisableScissor, "imguiGraphDisableScissor");
+}
+
+void imguiGraphFontTextureInit(unsigned char* data)
+{
+ return g_loader.function<14>(imguiGraphFontTextureInit, "imguiGraphFontTextureInit",data);
+}
+
+void imguiGraphFontTextureRelease()
+{
+ return g_loader.function<15>(imguiGraphFontTextureRelease, "imguiGraphFontTextureRelease");
+}
+
+bool imguiInteropGraphInit(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctx)
+{
+ return g_loader.function<16>(imguiInteropGraphInit, "imguiInteropGraphInit", func, fontpath, appctx);
+}
+
+void imguiInteropGraphUpdate(imguiGraphUpdate_t func, AppGraphCtx* appctx)
+{
+ return g_loader.function<17>(imguiInteropGraphUpdate, "imguiInteropGraphUpdate", func, appctx);
+} \ No newline at end of file