imgui/examples/example_apple
omar 0d7e779b37 Merge branch 'master' into osx
# Conflicts:
#	examples/.gitignore
#	examples/README.txt
2018-07-04 13:13:11 +02:00
..
imguiex-ios Fixed Travis path + various paths in comments/documentations 2018-06-10 16:14:43 +02:00
imguiex-osx Examples: Renamed example folders. (#1870) 2018-06-10 15:42:14 +02:00
imguiex.xcodeproj Examples: Apple: Fixed paths of GLFW+GL2 example. (#1906) Update ignore list. 2018-06-27 09:39:52 +02:00
README.md Fixed Travis path + various paths in comments/documentations 2018-06-10 16:14:43 +02:00

iOS / OSX example

Introduction

THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.

This example is the default XCode "OpenGL" example code, modified to support ImGui and Synergy to share mouse/keyboard on an iOS device.

It is a rather complex and messy example because of all of the faff required to get an XCode/iOS application running. Refer to the regular OpenGL examples if you want to learn about integrating ImGui. The code in example_glfw_opengl3/ should also work on OS X and is much simpler. This is an integration for iOS with Synergy.

Synergy (remote keyboard/mouse) is not required, but it's pretty hard to use ImGui without it. Synergy includes a "uSynergy" library that allows embedding a synergy client, this is what is used here. ImGui supports "TouchPadding", and this is enabled when Synergy is not active.

How to Use on iOS

  • In Synergy, go to Preferences, and uncheck "Use SSL encryption"
  • Run the example app.
  • Tap the "servername" button in the corner
  • Enter the name or the IP of your synergy host
  • If you had previously connected to a server, you may need to kill and re-start the app.

How to Build on OSX

  • Make sure you have install brew, if not, please refer to Homebrew Website
  • Run the command: brew install glfw3
  • Double click imguiex.xcodeproj and select imguiex-osx scheme
  • Click Run button

Notes and TODOs

Things that would be nice but I didn't get around to doing:

  • iOS software keyboard not supported for text inputs
  • iOS hardware (bluetooth) keyboards not supported
  • Graceful disconnect/reconnect from uSynergy.
  • Copy/Paste not well-supported

C++ on iOS / OSX

ImGui is a c++ library. If you want to include it directly, rename your Obj-C file to have the ".mm" extension.

Alternatively, you can wrap your debug code in a C interface, this is what I am demonstrating here with the "debug_hud.h" interface. Either approach works, use whatever you prefer.

In my case, most of my game code is already in C++ so it's not really an issue and I can use ImGui directly.