File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,11 @@ namespace ofxImGui
167167 // Note : In chaining mode, additional flags can still be set.
168168 io.ConfigFlags |= customFlags_;
169169
170+ // Inject touch flags by default on touch-only platforms
171+ #if defined(OFXIMGUI_TOUCH_EVENTS) && !defined(OFXIMGUI_TOUCH_EVENTS_AUTO_CONFIG)
172+ io.ConfigFlags |= ImGuiConfigFlags_IsTouchScreen;
173+ #endif
174+
170175 // Already-setup window --> slaves exit early
171176 if ( !isContextOwned ) {
172177#ifdef OFXIMGUI_DEBUG
Original file line number Diff line number Diff line change 3838 #define OFXIMGUI_COMPILER_MESSAGE (X )
3939#endif
4040
41+ // Touch events support ?
42+ // - - - - - - - - - - - - - - - -
43+ // Todo: add explicit compiler flag so devices such as Windows/Linux with TouchScreens can use it too ?
44+ #if defined(TARGET_OF_IOS ) || defined(TARGET_OF_ANDROID )
45+ #define OFXIMGUI_TOUCH_EVENTS
46+ #define OFXIMGUI_FORCE_OF_BACKEND // Note: force it bcoz there will probably never be GLFW support on mobile devices ?
47+ #endif
48+
4149// Platform backend selection
4250#if !defined(OFXIMGUI_FORCE_OF_BACKEND )
4351
6775
6876// Default backend : openframeworks
6977#ifndef OFXIMGUI_LOADED_BACKEND
70- OFXIMGUI_COMPILER_MESSAGE ("ofxImGui is compiling with the default openFrameworks backend." )
78+ OFXIMGUI_COMPILER_MESSAGE ("ofxImGui is compiling with the non- default openFrameworks backend." )
7179 #define OFXIMGUI_LOADED_BACKEND "OpenFrameworks"
7280 #define OFXIMGUI_BACKEND_OPENFRAMEWORKS
7381#endif
164172// Prevent using this flag in code
165173#undef OFXIMGUI_GLFW_FIX_MULTICONTEXT
166174
167- // Touch events support ?
168- // - - - - - - - - - - - - - - - -
169- // Todo: add explicit compiler flag so devices such as Windows/Linux with TouchScreens can use it too ?
170- #if defined(TARGET_OF_IOS ) || defined(TARGET_ANDROID )
171- #define OFXIMGUI_TOUCH_EVENTS
172- #endif
175+
You can’t perform that action at this time.
0 commit comments