1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-12 02:00:58 +01:00
imgui/examples/ios_example
2015-11-29 14:54:05 +00:00
..
imguiex Examples: Not clearing input data/tex data in atlas (will be required for dynamic atlas anyway). Effectively fix resizing in DX examples. 2015-11-29 14:54:05 +00:00
imguiex.xcodeproj fix ios compile error 2015-08-23 08:03:21 +08:00
.gitignore iOS example working based on modified OpenGL3 example + Synergy 2015-07-07 21:17:48 -06:00
README.md Examples: Possibly clarified the intent of imgui_impl_* files. 2015-10-13 17:53:43 +02:00

iOS example

Introduction

This example is the default XCode "OpenGL" example code, modified to support ImGui and Synergy.

It is a rather complex 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.

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

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

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

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.