Lagrange
imconfig.h
1/*
2 * Copyright 2020 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12//-----------------------------------------------------------------------------
13// COMPILE-TIME OPTIONS FOR DEAR IMGUI
14// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via
15// the ImGuiIO structure. You can use ImGui::SetAllocatorFunctions() before calling
16// ImGui::CreateContext() to rewire memory allocation functions.
17//-----------------------------------------------------------------------------
18// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/branch with your modifications to imconfig.h)
19// B) or add configuration directives in your own file and compile with #define IMGUI_USER_CONFIG
20// "myfilename.h" If you do so you need to make sure that configuration settings are defined
21// consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp files but also _any_
22// of your code that uses Dear ImGui. This is because some compile-time options have an affect on
23// data structures. Defining those options in imconfig.h will ensure every compilation unit gets to
24// see the same data structure layouts. Call IMGUI_CHECKVERSION() from your .cpp files to verify
25// that the data structures your files are using are matching the ones imgui.cpp is using.
26//-----------------------------------------------------------------------------
27
28#pragma once
29
30#include <Eigen/Core>
31
32//---- Define assertion handler. Defaults to calling assert().
33// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so
34// it can be used as a single statement.
35//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
36//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
37
38//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
39// Using dear imgui via a shared library is not recommended, because of function call overhead and
40// because we don't guarantee backward nor forward ABI compatibility.
41//#define IMGUI_API __declspec( dllexport )
42//#define IMGUI_API __declspec( dllimport )
43
44//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names.
45//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
46
47//---- Disable all of Dear ImGui or don't implement standard windows.
48// It is very strongly recommended to NOT disable the demo windows during development. Please read
49// comments in imgui_demo.cpp.
50//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
51//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended.
52//#define IMGUI_DISABLE_METRICS_WINDOW // Disable debug/metrics window: ShowMetricsWindow() will be empty.
53
54//---- Don't implement some functions to reduce linkage requirements.
55//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
56//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] Don't implement default IME handler. Won't use and link with ImmGetContext/ImmSetCompositionWindow.
57//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime).
58//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
59//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
60//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
61//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
62//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
63
64//---- Include imgui_user.h at the end of imgui.h as a convenience
65//#define IMGUI_INCLUDE_IMGUI_USER_H
66
67//---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another)
68//#define IMGUI_USE_BGRA_PACKED_COLOR
69
70//---- Use 32-bit for ImWchar (default is 16-bit) to support full unicode code points.
71//#define IMGUI_USE_WCHAR32
72
73//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
74// By default the embedded implementations are declared static and not available outside of imgui
75// cpp files.
76//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
77//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
78//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
79//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
80
81//---- Unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined, use the much faster STB sprintf
82// library implementation of vsnprintf instead of the one from the default C library.
83// Note that stb_sprintf.h is meant to be provided by the user and available in the include path at
84// compile time. Also, the compatibility checks of the arguments and formats done by clang and GCC
85// will be disabled in order to support the extra formats provided by STB sprintf. #define
86// IMGUI_USE_STB_SPRINTF
87
88//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
89// This will be inlined as part of ImVec2 and ImVec4 class declarations.
90#define IM_VEC2_CLASS_EXTRA \
91 ImVec2(const Eigen::Vector2f& f) \
92 { \
93 x = f.x(); \
94 y = f.y(); \
95 } \
96 operator Eigen::Vector2f() const { return Eigen::Vector2f(x, y); }
97
98#define IM_VEC4_CLASS_EXTRA \
99 ImVec4(const Eigen::Vector4f& f) \
100 { \
101 x = f.x(); \
102 y = f.y(); \
103 z = f.z(); \
104 w = f.w(); \
105 } \
106 operator Eigen::Vector4f() const { return Eigen::Vector4f(x, y, z, w); }
107
108
109//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than
110// 64K vertices.
111// Your renderer back-end will need to support it (most example renderer back-ends support both 16/32-bit indices).
112// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset
113// in your renderer. Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
114//#define ImDrawIdx unsigned int
115
116//---- Override ImDrawCallback signature (will need to modify renderer back-ends accordingly)
117// struct ImDrawList;
118// struct ImDrawCmd;
119// typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void*
120// my_renderer_user_data); #define ImDrawCallback MyImDrawCallback
121
122//---- Debug Tools: Macro to break in Debugger
123// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy
124// debugging.)
125//#define IM_DEBUG_BREAK IM_ASSERT(0)
126//#define IM_DEBUG_BREAK __debugbreak()
127
128//---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(),
129// (which comes earlier in the code, will catch a few extra items, allow picking items other than
130// Hovered one.) This adds a small runtime cost which is why it is not enabled by default.
131//#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
132
133//---- Debug Tools: Enable slower asserts
134//#define IMGUI_DEBUG_PARANOID
135
136//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers
137// files.
138/*
139namespace ImGui
140{
141 void MyFunction(const char* name, const MyMatrix44& v);
142}
143*/