vsgImGui: include/vsgImGui/Export.h Source File

vsgImGui 0.7.0 VulkanSceneGraph, ImGui and ImPlot integration library

Loading...
Searching...
No Matches
Export.h
1#pragma once
2
3/* <editor-fold desc="MIT License">
4
5Copyright(c) 2021 Robert Osfield
6
7Permission is hereby granted, free of charge, to any person obtaining a copy of
8this software and associated documentation files (the "Software"), to deal in
9the Software without restriction, including without limitation the rights to
10use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11the Software, and to permit persons to whom the Software is furnished to do so,
12subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24</editor-fold> */
25
26#if (defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__))
27# if defined(vsgImGui_EXPORTS)
28# define VSGIMGUI_DECLSPEC __declspec(dllexport)
29# elif defined(VSGIMGUI_SHARED_LIBRARY)
30# define VSGIMGUI_DECLSPEC __declspec(dllimport)
31# else
32# define VSGIMGUI_DECLSPEC
33# endif
34#else
35# define VSGIMGUI_DECLSPEC
36#endif
37
38#define IMGUI_API VSGIMGUI_DECLSPEC
39#define IMPLOT_API VSGIMGUI_DECLSPEC
40
41#include <vulkan/vulkan.h>
42#define ImTextureID VkDescriptorSet
43
44#include <vsg/maths/vec2.h>
45#include <vsg/maths/vec4.h>
46
47#define IM_VEC2_CLASS_EXTRA \
48 constexpr ImVec2(const vsg::vec2& v) : x(v.x), y(v.y) \
49 { \
50 } \
51 operator vsg::vec2() const \
52 { \
53 return vsg::vec2(x, y); \
54 }
55
56#define IM_VEC4_CLASS_EXTRA \
57 constexpr ImVec4(const vsg::vec4& v) : x(v.x), y(v.y), z(v.z), w(v.w) \
58 { \
59 } \
60 operator vsg::vec4() const \
61 { \
62 return vsg::vec4(x, y, z, w); \
63 }