diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/examples/example_apple_metal/Shared/AppDelegate.h b/examples/example_apple_metal/Shared/AppDelegate.h
new file mode 100644
index 0000000..c4632b1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.h
@@ -0,0 +1,19 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+#else
+
+#import
+
+@interface AppDelegate : NSObject
+@end
+
+#endif
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/examples/example_apple_metal/Shared/AppDelegate.h b/examples/example_apple_metal/Shared/AppDelegate.h
new file mode 100644
index 0000000..c4632b1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.h
@@ -0,0 +1,19 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+#else
+
+#import
+
+@interface AppDelegate : NSObject
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/AppDelegate.m b/examples/example_apple_metal/Shared/AppDelegate.m
new file mode 100644
index 0000000..eabb44c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.m
@@ -0,0 +1,12 @@
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+#if TARGET_OS_OSX
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
+ return YES;
+}
+#endif
+
+@end
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/examples/example_apple_metal/Shared/AppDelegate.h b/examples/example_apple_metal/Shared/AppDelegate.h
new file mode 100644
index 0000000..c4632b1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.h
@@ -0,0 +1,19 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+#else
+
+#import
+
+@interface AppDelegate : NSObject
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/AppDelegate.m b/examples/example_apple_metal/Shared/AppDelegate.m
new file mode 100644
index 0000000..eabb44c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.m
@@ -0,0 +1,12 @@
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+#if TARGET_OS_OSX
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
+ return YES;
+}
+#endif
+
+@end
diff --git a/examples/example_apple_metal/Shared/Renderer.h b/examples/example_apple_metal/Shared/Renderer.h
new file mode 100644
index 0000000..f324915
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.h
@@ -0,0 +1,9 @@
+
+#import
+
+@interface Renderer : NSObject
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+
+@end
+
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/examples/example_apple_metal/Shared/AppDelegate.h b/examples/example_apple_metal/Shared/AppDelegate.h
new file mode 100644
index 0000000..c4632b1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.h
@@ -0,0 +1,19 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+#else
+
+#import
+
+@interface AppDelegate : NSObject
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/AppDelegate.m b/examples/example_apple_metal/Shared/AppDelegate.m
new file mode 100644
index 0000000..eabb44c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.m
@@ -0,0 +1,12 @@
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+#if TARGET_OS_OSX
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
+ return YES;
+}
+#endif
+
+@end
diff --git a/examples/example_apple_metal/Shared/Renderer.h b/examples/example_apple_metal/Shared/Renderer.h
new file mode 100644
index 0000000..f324915
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.h
@@ -0,0 +1,9 @@
+
+#import
+
+@interface Renderer : NSObject
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/Renderer.mm b/examples/example_apple_metal/Shared/Renderer.mm
new file mode 100644
index 0000000..2f62ed1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.mm
@@ -0,0 +1,132 @@
+
+#import "Renderer.h"
+#import
+
+#include "imgui.h"
+#include "imgui_impl_metal.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface Renderer ()
+@property (nonatomic, strong) id device;
+@property (nonatomic, strong) id commandQueue;
+@end
+
+@implementation Renderer
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+{
+ self = [super init];
+ if(self)
+ {
+ _device = view.device;
+ _commandQueue = [_device newCommandQueue];
+
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ (void)ImGui::GetIO();
+
+ ImGui_ImplMetal_Init(_device);
+
+ ImGui::StyleColorsDark();
+ }
+
+ return self;
+}
+
+- (void)drawInMTKView:(MTKView *)view
+{
+ ImGuiIO &io = ImGui::GetIO();
+ io.DisplaySize.x = view.bounds.size.width;
+ io.DisplaySize.y = view.bounds.size.height;
+
+#if TARGET_OS_OSX
+ CGFloat framebufferScale = view.window.screen.backingScaleFactor ?: NSScreen.mainScreen.backingScaleFactor;
+#else
+ CGFloat framebufferScale = view.window.screen.scale ?: UIScreen.mainScreen.scale;
+#endif
+ io.DisplayFramebufferScale = ImVec2(framebufferScale, framebufferScale);
+
+ io.DeltaTime = 1 / float(view.preferredFramesPerSecond ?: 60);
+
+ id commandBuffer = [self.commandQueue commandBuffer];
+
+ static bool show_demo_window = true;
+ static bool show_another_window = false;
+ static float clear_color[4] = { 0.28f, 0.36f, 0.5f, 1.0f };
+
+ MTLRenderPassDescriptor *renderPassDescriptor = view.currentRenderPassDescriptor;
+ if(renderPassDescriptor != nil)
+ {
+ renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(clear_color[0], clear_color[1], clear_color[2], clear_color[3]);
+
+ // Here, you could do additional rendering work, including other passes as necessary.
+
+ id renderEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
+
+ [renderEncoder pushDebugGroup:@"Draw ImGui"];
+
+ ImGui_ImplMetal_NewFrame(renderPassDescriptor);
+#if TARGET_OS_OSX
+ ImGui_ImplOSX_NewFrame(view);
+#endif
+ ImGui::NewFrame();
+
+ {
+ static float f = 0.0f;
+ static int counter = 0;
+ ImGui::Text("Hello, world!"); // Display some text (you can use a format string too)
+ ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
+ ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
+
+ ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our windows open/close state
+ ImGui::Checkbox("Another Window", &show_another_window);
+
+ if (ImGui::Button("Button")) // Buttons return true when clicked (NB: most widgets return true when edited/activated)
+ counter++;
+ ImGui::SameLine();
+ ImGui::Text("counter = %d", counter);
+
+ ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
+ }
+
+ // 2. Show another simple window. In most cases you will use an explicit Begin/End pair to name your windows.
+ if (show_another_window)
+ {
+ ImGui::Begin("Another Window", &show_another_window);
+ ImGui::Text("Hello from another window!");
+ if (ImGui::Button("Close Me"))
+ show_another_window = false;
+ ImGui::End();
+ }
+
+ // 3. Show the ImGui demo window. Most of the sample code is in ImGui::ShowDemoWindow(). Read its code to learn more about Dear ImGui!
+ if (show_demo_window)
+ {
+ // Normally user code doesn't need/want to call this because positions are saved in .ini file anyway.
+ // Here we just want to make the demo initial state a bit more friendly!
+ ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
+ ImGui::ShowDemoWindow(&show_demo_window);
+ }
+
+ ImGui::Render();
+ ImDrawData *drawData = ImGui::GetDrawData();
+ ImGui_ImplMetal_RenderDrawData(drawData, commandBuffer, renderEncoder);
+
+ [renderEncoder popDebugGroup];
+
+ [renderEncoder endEncoding];
+
+ [commandBuffer presentDrawable:view.currentDrawable];
+ }
+
+ [commandBuffer commit];
+}
+
+- (void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size
+{
+}
+
+@end
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/examples/example_apple_metal/Shared/AppDelegate.h b/examples/example_apple_metal/Shared/AppDelegate.h
new file mode 100644
index 0000000..c4632b1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.h
@@ -0,0 +1,19 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+#else
+
+#import
+
+@interface AppDelegate : NSObject
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/AppDelegate.m b/examples/example_apple_metal/Shared/AppDelegate.m
new file mode 100644
index 0000000..eabb44c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.m
@@ -0,0 +1,12 @@
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+#if TARGET_OS_OSX
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
+ return YES;
+}
+#endif
+
+@end
diff --git a/examples/example_apple_metal/Shared/Renderer.h b/examples/example_apple_metal/Shared/Renderer.h
new file mode 100644
index 0000000..f324915
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.h
@@ -0,0 +1,9 @@
+
+#import
+
+@interface Renderer : NSObject
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/Renderer.mm b/examples/example_apple_metal/Shared/Renderer.mm
new file mode 100644
index 0000000..2f62ed1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.mm
@@ -0,0 +1,132 @@
+
+#import "Renderer.h"
+#import
+
+#include "imgui.h"
+#include "imgui_impl_metal.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface Renderer ()
+@property (nonatomic, strong) id device;
+@property (nonatomic, strong) id commandQueue;
+@end
+
+@implementation Renderer
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+{
+ self = [super init];
+ if(self)
+ {
+ _device = view.device;
+ _commandQueue = [_device newCommandQueue];
+
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ (void)ImGui::GetIO();
+
+ ImGui_ImplMetal_Init(_device);
+
+ ImGui::StyleColorsDark();
+ }
+
+ return self;
+}
+
+- (void)drawInMTKView:(MTKView *)view
+{
+ ImGuiIO &io = ImGui::GetIO();
+ io.DisplaySize.x = view.bounds.size.width;
+ io.DisplaySize.y = view.bounds.size.height;
+
+#if TARGET_OS_OSX
+ CGFloat framebufferScale = view.window.screen.backingScaleFactor ?: NSScreen.mainScreen.backingScaleFactor;
+#else
+ CGFloat framebufferScale = view.window.screen.scale ?: UIScreen.mainScreen.scale;
+#endif
+ io.DisplayFramebufferScale = ImVec2(framebufferScale, framebufferScale);
+
+ io.DeltaTime = 1 / float(view.preferredFramesPerSecond ?: 60);
+
+ id commandBuffer = [self.commandQueue commandBuffer];
+
+ static bool show_demo_window = true;
+ static bool show_another_window = false;
+ static float clear_color[4] = { 0.28f, 0.36f, 0.5f, 1.0f };
+
+ MTLRenderPassDescriptor *renderPassDescriptor = view.currentRenderPassDescriptor;
+ if(renderPassDescriptor != nil)
+ {
+ renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(clear_color[0], clear_color[1], clear_color[2], clear_color[3]);
+
+ // Here, you could do additional rendering work, including other passes as necessary.
+
+ id renderEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
+
+ [renderEncoder pushDebugGroup:@"Draw ImGui"];
+
+ ImGui_ImplMetal_NewFrame(renderPassDescriptor);
+#if TARGET_OS_OSX
+ ImGui_ImplOSX_NewFrame(view);
+#endif
+ ImGui::NewFrame();
+
+ {
+ static float f = 0.0f;
+ static int counter = 0;
+ ImGui::Text("Hello, world!"); // Display some text (you can use a format string too)
+ ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
+ ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
+
+ ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our windows open/close state
+ ImGui::Checkbox("Another Window", &show_another_window);
+
+ if (ImGui::Button("Button")) // Buttons return true when clicked (NB: most widgets return true when edited/activated)
+ counter++;
+ ImGui::SameLine();
+ ImGui::Text("counter = %d", counter);
+
+ ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
+ }
+
+ // 2. Show another simple window. In most cases you will use an explicit Begin/End pair to name your windows.
+ if (show_another_window)
+ {
+ ImGui::Begin("Another Window", &show_another_window);
+ ImGui::Text("Hello from another window!");
+ if (ImGui::Button("Close Me"))
+ show_another_window = false;
+ ImGui::End();
+ }
+
+ // 3. Show the ImGui demo window. Most of the sample code is in ImGui::ShowDemoWindow(). Read its code to learn more about Dear ImGui!
+ if (show_demo_window)
+ {
+ // Normally user code doesn't need/want to call this because positions are saved in .ini file anyway.
+ // Here we just want to make the demo initial state a bit more friendly!
+ ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
+ ImGui::ShowDemoWindow(&show_demo_window);
+ }
+
+ ImGui::Render();
+ ImDrawData *drawData = ImGui::GetDrawData();
+ ImGui_ImplMetal_RenderDrawData(drawData, commandBuffer, renderEncoder);
+
+ [renderEncoder popDebugGroup];
+
+ [renderEncoder endEncoding];
+
+ [commandBuffer presentDrawable:view.currentDrawable];
+ }
+
+ [commandBuffer commit];
+}
+
+- (void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size
+{
+}
+
+@end
diff --git a/examples/example_apple_metal/Shared/ViewController.h b/examples/example_apple_metal/Shared/ViewController.h
new file mode 100644
index 0000000..a8aade1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.h
@@ -0,0 +1,20 @@
+
+#import
+#import
+#import "Renderer.h"
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface ViewController : UIViewController
+@end
+
+#else
+
+#import
+
+@interface ViewController : NSViewController
+@end
+
+#endif
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/examples/example_apple_metal/Shared/AppDelegate.h b/examples/example_apple_metal/Shared/AppDelegate.h
new file mode 100644
index 0000000..c4632b1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.h
@@ -0,0 +1,19 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+#else
+
+#import
+
+@interface AppDelegate : NSObject
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/AppDelegate.m b/examples/example_apple_metal/Shared/AppDelegate.m
new file mode 100644
index 0000000..eabb44c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.m
@@ -0,0 +1,12 @@
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+#if TARGET_OS_OSX
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
+ return YES;
+}
+#endif
+
+@end
diff --git a/examples/example_apple_metal/Shared/Renderer.h b/examples/example_apple_metal/Shared/Renderer.h
new file mode 100644
index 0000000..f324915
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.h
@@ -0,0 +1,9 @@
+
+#import
+
+@interface Renderer : NSObject
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/Renderer.mm b/examples/example_apple_metal/Shared/Renderer.mm
new file mode 100644
index 0000000..2f62ed1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.mm
@@ -0,0 +1,132 @@
+
+#import "Renderer.h"
+#import
+
+#include "imgui.h"
+#include "imgui_impl_metal.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface Renderer ()
+@property (nonatomic, strong) id device;
+@property (nonatomic, strong) id commandQueue;
+@end
+
+@implementation Renderer
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+{
+ self = [super init];
+ if(self)
+ {
+ _device = view.device;
+ _commandQueue = [_device newCommandQueue];
+
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ (void)ImGui::GetIO();
+
+ ImGui_ImplMetal_Init(_device);
+
+ ImGui::StyleColorsDark();
+ }
+
+ return self;
+}
+
+- (void)drawInMTKView:(MTKView *)view
+{
+ ImGuiIO &io = ImGui::GetIO();
+ io.DisplaySize.x = view.bounds.size.width;
+ io.DisplaySize.y = view.bounds.size.height;
+
+#if TARGET_OS_OSX
+ CGFloat framebufferScale = view.window.screen.backingScaleFactor ?: NSScreen.mainScreen.backingScaleFactor;
+#else
+ CGFloat framebufferScale = view.window.screen.scale ?: UIScreen.mainScreen.scale;
+#endif
+ io.DisplayFramebufferScale = ImVec2(framebufferScale, framebufferScale);
+
+ io.DeltaTime = 1 / float(view.preferredFramesPerSecond ?: 60);
+
+ id commandBuffer = [self.commandQueue commandBuffer];
+
+ static bool show_demo_window = true;
+ static bool show_another_window = false;
+ static float clear_color[4] = { 0.28f, 0.36f, 0.5f, 1.0f };
+
+ MTLRenderPassDescriptor *renderPassDescriptor = view.currentRenderPassDescriptor;
+ if(renderPassDescriptor != nil)
+ {
+ renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(clear_color[0], clear_color[1], clear_color[2], clear_color[3]);
+
+ // Here, you could do additional rendering work, including other passes as necessary.
+
+ id renderEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
+
+ [renderEncoder pushDebugGroup:@"Draw ImGui"];
+
+ ImGui_ImplMetal_NewFrame(renderPassDescriptor);
+#if TARGET_OS_OSX
+ ImGui_ImplOSX_NewFrame(view);
+#endif
+ ImGui::NewFrame();
+
+ {
+ static float f = 0.0f;
+ static int counter = 0;
+ ImGui::Text("Hello, world!"); // Display some text (you can use a format string too)
+ ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
+ ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
+
+ ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our windows open/close state
+ ImGui::Checkbox("Another Window", &show_another_window);
+
+ if (ImGui::Button("Button")) // Buttons return true when clicked (NB: most widgets return true when edited/activated)
+ counter++;
+ ImGui::SameLine();
+ ImGui::Text("counter = %d", counter);
+
+ ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
+ }
+
+ // 2. Show another simple window. In most cases you will use an explicit Begin/End pair to name your windows.
+ if (show_another_window)
+ {
+ ImGui::Begin("Another Window", &show_another_window);
+ ImGui::Text("Hello from another window!");
+ if (ImGui::Button("Close Me"))
+ show_another_window = false;
+ ImGui::End();
+ }
+
+ // 3. Show the ImGui demo window. Most of the sample code is in ImGui::ShowDemoWindow(). Read its code to learn more about Dear ImGui!
+ if (show_demo_window)
+ {
+ // Normally user code doesn't need/want to call this because positions are saved in .ini file anyway.
+ // Here we just want to make the demo initial state a bit more friendly!
+ ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
+ ImGui::ShowDemoWindow(&show_demo_window);
+ }
+
+ ImGui::Render();
+ ImDrawData *drawData = ImGui::GetDrawData();
+ ImGui_ImplMetal_RenderDrawData(drawData, commandBuffer, renderEncoder);
+
+ [renderEncoder popDebugGroup];
+
+ [renderEncoder endEncoding];
+
+ [commandBuffer presentDrawable:view.currentDrawable];
+ }
+
+ [commandBuffer commit];
+}
+
+- (void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size
+{
+}
+
+@end
diff --git a/examples/example_apple_metal/Shared/ViewController.h b/examples/example_apple_metal/Shared/ViewController.h
new file mode 100644
index 0000000..a8aade1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.h
@@ -0,0 +1,20 @@
+
+#import
+#import
+#import "Renderer.h"
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface ViewController : UIViewController
+@end
+
+#else
+
+#import
+
+@interface ViewController : NSViewController
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/ViewController.mm b/examples/example_apple_metal/Shared/ViewController.mm
new file mode 100644
index 0000000..6a9236c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.mm
@@ -0,0 +1,130 @@
+
+#import "ViewController.h"
+#import "Renderer.h"
+#include "imgui.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface ViewController ()
+@property (nonatomic, readonly) MTKView *mtkView;
+@property (nonatomic, strong) Renderer *renderer;
+@end
+
+@implementation ViewController
+
+- (MTKView *)mtkView {
+ return (MTKView *)self.view;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.mtkView.device = MTLCreateSystemDefaultDevice();
+
+ if (!self.mtkView.device) {
+ NSLog(@"Metal is not supported");
+ abort();
+ }
+
+ self.renderer = [[Renderer alloc] initWithView:self.mtkView];
+
+ [self.renderer mtkView:self.mtkView drawableSizeWillChange:self.mtkView.bounds.size];
+
+ self.mtkView.delegate = self.renderer;
+
+#if TARGET_OS_OSX
+ // Add a tracking area in order to receive mouse events whenever the mouse is within the bounds of our view
+ NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:NSZeroRect
+ options:NSTrackingMouseMoved | NSTrackingInVisibleRect | NSTrackingActiveAlways
+ owner:self
+ userInfo:nil];
+ [self.view addTrackingArea:trackingArea];
+
+ // If we want to receive key events, we either need to be in the responder chain of the key view,
+ // or else we can install a local monitor. The consequence of this heavy-handed approach is that
+ // we receive events for all controls, not just ImGui widgets. If we had native controls in our
+ // window, we'd want to be much more careful than just ingesting the complete event stream, though
+ // we do make an effort to be good citizens by passing along events when ImGui doesn't want to capture.
+ NSEventMask eventMask = NSEventMaskKeyDown | NSEventMaskKeyUp | NSEventMaskFlagsChanged | NSEventTypeScrollWheel;
+ [NSEvent addLocalMonitorForEventsMatchingMask:eventMask handler:^NSEvent * _Nullable(NSEvent *event) {
+ BOOL wantsCapture = ImGui_ImplOSX_HandleEvent(event, self.view);
+ if (event.type == NSEventTypeKeyDown && wantsCapture) {
+ return nil;
+ } else {
+ return event;
+ }
+
+ }];
+
+ ImGui_ImplOSX_Init();
+#endif
+}
+
+#if TARGET_OS_OSX
+
+- (void)mouseMoved:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseDown:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseUp:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseDragged:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)scrollWheel:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+#elif TARGET_OS_IOS
+
+// This touch mapping is super cheesy/hacky. We treat any touch on the screen
+// as if it were a depressed left mouse button, and we don't bother handling
+// multitouch correctly at all. This causes the "cursor" to behave very erratically
+// when there are multiple active touches. But for demo purposes, single-touch
+// interaction actually works surprisingly well.
+- (void)updateIOWithTouchEvent:(UIEvent *)event {
+ UITouch *anyTouch = event.allTouches.anyObject;
+ CGPoint touchLocation = [anyTouch locationInView:self.view];
+ ImGuiIO &io = ImGui::GetIO();
+ io.MousePos = ImVec2(touchLocation.x, touchLocation.y);
+
+ BOOL hasActiveTouch = NO;
+ for (UITouch *touch in event.allTouches) {
+ if (touch.phase != UITouchPhaseEnded && touch.phase != UITouchPhaseCancelled) {
+ hasActiveTouch = YES;
+ break;
+ }
+ }
+ io.MouseDown[0] = hasActiveTouch;
+}
+
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+#endif
+
+@end
+
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/examples/example_apple_metal/Shared/AppDelegate.h b/examples/example_apple_metal/Shared/AppDelegate.h
new file mode 100644
index 0000000..c4632b1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.h
@@ -0,0 +1,19 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+#else
+
+#import
+
+@interface AppDelegate : NSObject
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/AppDelegate.m b/examples/example_apple_metal/Shared/AppDelegate.m
new file mode 100644
index 0000000..eabb44c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.m
@@ -0,0 +1,12 @@
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+#if TARGET_OS_OSX
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
+ return YES;
+}
+#endif
+
+@end
diff --git a/examples/example_apple_metal/Shared/Renderer.h b/examples/example_apple_metal/Shared/Renderer.h
new file mode 100644
index 0000000..f324915
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.h
@@ -0,0 +1,9 @@
+
+#import
+
+@interface Renderer : NSObject
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/Renderer.mm b/examples/example_apple_metal/Shared/Renderer.mm
new file mode 100644
index 0000000..2f62ed1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.mm
@@ -0,0 +1,132 @@
+
+#import "Renderer.h"
+#import
+
+#include "imgui.h"
+#include "imgui_impl_metal.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface Renderer ()
+@property (nonatomic, strong) id device;
+@property (nonatomic, strong) id commandQueue;
+@end
+
+@implementation Renderer
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+{
+ self = [super init];
+ if(self)
+ {
+ _device = view.device;
+ _commandQueue = [_device newCommandQueue];
+
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ (void)ImGui::GetIO();
+
+ ImGui_ImplMetal_Init(_device);
+
+ ImGui::StyleColorsDark();
+ }
+
+ return self;
+}
+
+- (void)drawInMTKView:(MTKView *)view
+{
+ ImGuiIO &io = ImGui::GetIO();
+ io.DisplaySize.x = view.bounds.size.width;
+ io.DisplaySize.y = view.bounds.size.height;
+
+#if TARGET_OS_OSX
+ CGFloat framebufferScale = view.window.screen.backingScaleFactor ?: NSScreen.mainScreen.backingScaleFactor;
+#else
+ CGFloat framebufferScale = view.window.screen.scale ?: UIScreen.mainScreen.scale;
+#endif
+ io.DisplayFramebufferScale = ImVec2(framebufferScale, framebufferScale);
+
+ io.DeltaTime = 1 / float(view.preferredFramesPerSecond ?: 60);
+
+ id commandBuffer = [self.commandQueue commandBuffer];
+
+ static bool show_demo_window = true;
+ static bool show_another_window = false;
+ static float clear_color[4] = { 0.28f, 0.36f, 0.5f, 1.0f };
+
+ MTLRenderPassDescriptor *renderPassDescriptor = view.currentRenderPassDescriptor;
+ if(renderPassDescriptor != nil)
+ {
+ renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(clear_color[0], clear_color[1], clear_color[2], clear_color[3]);
+
+ // Here, you could do additional rendering work, including other passes as necessary.
+
+ id renderEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
+
+ [renderEncoder pushDebugGroup:@"Draw ImGui"];
+
+ ImGui_ImplMetal_NewFrame(renderPassDescriptor);
+#if TARGET_OS_OSX
+ ImGui_ImplOSX_NewFrame(view);
+#endif
+ ImGui::NewFrame();
+
+ {
+ static float f = 0.0f;
+ static int counter = 0;
+ ImGui::Text("Hello, world!"); // Display some text (you can use a format string too)
+ ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
+ ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
+
+ ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our windows open/close state
+ ImGui::Checkbox("Another Window", &show_another_window);
+
+ if (ImGui::Button("Button")) // Buttons return true when clicked (NB: most widgets return true when edited/activated)
+ counter++;
+ ImGui::SameLine();
+ ImGui::Text("counter = %d", counter);
+
+ ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
+ }
+
+ // 2. Show another simple window. In most cases you will use an explicit Begin/End pair to name your windows.
+ if (show_another_window)
+ {
+ ImGui::Begin("Another Window", &show_another_window);
+ ImGui::Text("Hello from another window!");
+ if (ImGui::Button("Close Me"))
+ show_another_window = false;
+ ImGui::End();
+ }
+
+ // 3. Show the ImGui demo window. Most of the sample code is in ImGui::ShowDemoWindow(). Read its code to learn more about Dear ImGui!
+ if (show_demo_window)
+ {
+ // Normally user code doesn't need/want to call this because positions are saved in .ini file anyway.
+ // Here we just want to make the demo initial state a bit more friendly!
+ ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
+ ImGui::ShowDemoWindow(&show_demo_window);
+ }
+
+ ImGui::Render();
+ ImDrawData *drawData = ImGui::GetDrawData();
+ ImGui_ImplMetal_RenderDrawData(drawData, commandBuffer, renderEncoder);
+
+ [renderEncoder popDebugGroup];
+
+ [renderEncoder endEncoding];
+
+ [commandBuffer presentDrawable:view.currentDrawable];
+ }
+
+ [commandBuffer commit];
+}
+
+- (void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size
+{
+}
+
+@end
diff --git a/examples/example_apple_metal/Shared/ViewController.h b/examples/example_apple_metal/Shared/ViewController.h
new file mode 100644
index 0000000..a8aade1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.h
@@ -0,0 +1,20 @@
+
+#import
+#import
+#import "Renderer.h"
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface ViewController : UIViewController
+@end
+
+#else
+
+#import
+
+@interface ViewController : NSViewController
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/ViewController.mm b/examples/example_apple_metal/Shared/ViewController.mm
new file mode 100644
index 0000000..6a9236c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.mm
@@ -0,0 +1,130 @@
+
+#import "ViewController.h"
+#import "Renderer.h"
+#include "imgui.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface ViewController ()
+@property (nonatomic, readonly) MTKView *mtkView;
+@property (nonatomic, strong) Renderer *renderer;
+@end
+
+@implementation ViewController
+
+- (MTKView *)mtkView {
+ return (MTKView *)self.view;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.mtkView.device = MTLCreateSystemDefaultDevice();
+
+ if (!self.mtkView.device) {
+ NSLog(@"Metal is not supported");
+ abort();
+ }
+
+ self.renderer = [[Renderer alloc] initWithView:self.mtkView];
+
+ [self.renderer mtkView:self.mtkView drawableSizeWillChange:self.mtkView.bounds.size];
+
+ self.mtkView.delegate = self.renderer;
+
+#if TARGET_OS_OSX
+ // Add a tracking area in order to receive mouse events whenever the mouse is within the bounds of our view
+ NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:NSZeroRect
+ options:NSTrackingMouseMoved | NSTrackingInVisibleRect | NSTrackingActiveAlways
+ owner:self
+ userInfo:nil];
+ [self.view addTrackingArea:trackingArea];
+
+ // If we want to receive key events, we either need to be in the responder chain of the key view,
+ // or else we can install a local monitor. The consequence of this heavy-handed approach is that
+ // we receive events for all controls, not just ImGui widgets. If we had native controls in our
+ // window, we'd want to be much more careful than just ingesting the complete event stream, though
+ // we do make an effort to be good citizens by passing along events when ImGui doesn't want to capture.
+ NSEventMask eventMask = NSEventMaskKeyDown | NSEventMaskKeyUp | NSEventMaskFlagsChanged | NSEventTypeScrollWheel;
+ [NSEvent addLocalMonitorForEventsMatchingMask:eventMask handler:^NSEvent * _Nullable(NSEvent *event) {
+ BOOL wantsCapture = ImGui_ImplOSX_HandleEvent(event, self.view);
+ if (event.type == NSEventTypeKeyDown && wantsCapture) {
+ return nil;
+ } else {
+ return event;
+ }
+
+ }];
+
+ ImGui_ImplOSX_Init();
+#endif
+}
+
+#if TARGET_OS_OSX
+
+- (void)mouseMoved:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseDown:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseUp:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseDragged:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)scrollWheel:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+#elif TARGET_OS_IOS
+
+// This touch mapping is super cheesy/hacky. We treat any touch on the screen
+// as if it were a depressed left mouse button, and we don't bother handling
+// multitouch correctly at all. This causes the "cursor" to behave very erratically
+// when there are multiple active touches. But for demo purposes, single-touch
+// interaction actually works surprisingly well.
+- (void)updateIOWithTouchEvent:(UIEvent *)event {
+ UITouch *anyTouch = event.allTouches.anyObject;
+ CGPoint touchLocation = [anyTouch locationInView:self.view];
+ ImGuiIO &io = ImGui::GetIO();
+ io.MousePos = ImVec2(touchLocation.x, touchLocation.y);
+
+ BOOL hasActiveTouch = NO;
+ for (UITouch *touch in event.allTouches) {
+ if (touch.phase != UITouchPhaseEnded && touch.phase != UITouchPhaseCancelled) {
+ hasActiveTouch = YES;
+ break;
+ }
+ }
+ io.MouseDown[0] = hasActiveTouch;
+}
+
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+#endif
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/main.m b/examples/example_apple_metal/Shared/main.m
new file mode 100644
index 0000000..cd8468a
--- /dev/null
+++ b/examples/example_apple_metal/Shared/main.m
@@ -0,0 +1,23 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[]) {
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
+
+#else
+
+#import
+
+int main(int argc, const char * argv[]) {
+ return NSApplicationMain(argc, argv);
+}
+
+#endif
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/examples/example_apple_metal/Shared/AppDelegate.h b/examples/example_apple_metal/Shared/AppDelegate.h
new file mode 100644
index 0000000..c4632b1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.h
@@ -0,0 +1,19 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+#else
+
+#import
+
+@interface AppDelegate : NSObject
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/AppDelegate.m b/examples/example_apple_metal/Shared/AppDelegate.m
new file mode 100644
index 0000000..eabb44c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.m
@@ -0,0 +1,12 @@
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+#if TARGET_OS_OSX
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
+ return YES;
+}
+#endif
+
+@end
diff --git a/examples/example_apple_metal/Shared/Renderer.h b/examples/example_apple_metal/Shared/Renderer.h
new file mode 100644
index 0000000..f324915
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.h
@@ -0,0 +1,9 @@
+
+#import
+
+@interface Renderer : NSObject
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/Renderer.mm b/examples/example_apple_metal/Shared/Renderer.mm
new file mode 100644
index 0000000..2f62ed1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.mm
@@ -0,0 +1,132 @@
+
+#import "Renderer.h"
+#import
+
+#include "imgui.h"
+#include "imgui_impl_metal.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface Renderer ()
+@property (nonatomic, strong) id device;
+@property (nonatomic, strong) id commandQueue;
+@end
+
+@implementation Renderer
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+{
+ self = [super init];
+ if(self)
+ {
+ _device = view.device;
+ _commandQueue = [_device newCommandQueue];
+
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ (void)ImGui::GetIO();
+
+ ImGui_ImplMetal_Init(_device);
+
+ ImGui::StyleColorsDark();
+ }
+
+ return self;
+}
+
+- (void)drawInMTKView:(MTKView *)view
+{
+ ImGuiIO &io = ImGui::GetIO();
+ io.DisplaySize.x = view.bounds.size.width;
+ io.DisplaySize.y = view.bounds.size.height;
+
+#if TARGET_OS_OSX
+ CGFloat framebufferScale = view.window.screen.backingScaleFactor ?: NSScreen.mainScreen.backingScaleFactor;
+#else
+ CGFloat framebufferScale = view.window.screen.scale ?: UIScreen.mainScreen.scale;
+#endif
+ io.DisplayFramebufferScale = ImVec2(framebufferScale, framebufferScale);
+
+ io.DeltaTime = 1 / float(view.preferredFramesPerSecond ?: 60);
+
+ id commandBuffer = [self.commandQueue commandBuffer];
+
+ static bool show_demo_window = true;
+ static bool show_another_window = false;
+ static float clear_color[4] = { 0.28f, 0.36f, 0.5f, 1.0f };
+
+ MTLRenderPassDescriptor *renderPassDescriptor = view.currentRenderPassDescriptor;
+ if(renderPassDescriptor != nil)
+ {
+ renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(clear_color[0], clear_color[1], clear_color[2], clear_color[3]);
+
+ // Here, you could do additional rendering work, including other passes as necessary.
+
+ id renderEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
+
+ [renderEncoder pushDebugGroup:@"Draw ImGui"];
+
+ ImGui_ImplMetal_NewFrame(renderPassDescriptor);
+#if TARGET_OS_OSX
+ ImGui_ImplOSX_NewFrame(view);
+#endif
+ ImGui::NewFrame();
+
+ {
+ static float f = 0.0f;
+ static int counter = 0;
+ ImGui::Text("Hello, world!"); // Display some text (you can use a format string too)
+ ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
+ ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
+
+ ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our windows open/close state
+ ImGui::Checkbox("Another Window", &show_another_window);
+
+ if (ImGui::Button("Button")) // Buttons return true when clicked (NB: most widgets return true when edited/activated)
+ counter++;
+ ImGui::SameLine();
+ ImGui::Text("counter = %d", counter);
+
+ ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
+ }
+
+ // 2. Show another simple window. In most cases you will use an explicit Begin/End pair to name your windows.
+ if (show_another_window)
+ {
+ ImGui::Begin("Another Window", &show_another_window);
+ ImGui::Text("Hello from another window!");
+ if (ImGui::Button("Close Me"))
+ show_another_window = false;
+ ImGui::End();
+ }
+
+ // 3. Show the ImGui demo window. Most of the sample code is in ImGui::ShowDemoWindow(). Read its code to learn more about Dear ImGui!
+ if (show_demo_window)
+ {
+ // Normally user code doesn't need/want to call this because positions are saved in .ini file anyway.
+ // Here we just want to make the demo initial state a bit more friendly!
+ ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
+ ImGui::ShowDemoWindow(&show_demo_window);
+ }
+
+ ImGui::Render();
+ ImDrawData *drawData = ImGui::GetDrawData();
+ ImGui_ImplMetal_RenderDrawData(drawData, commandBuffer, renderEncoder);
+
+ [renderEncoder popDebugGroup];
+
+ [renderEncoder endEncoding];
+
+ [commandBuffer presentDrawable:view.currentDrawable];
+ }
+
+ [commandBuffer commit];
+}
+
+- (void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size
+{
+}
+
+@end
diff --git a/examples/example_apple_metal/Shared/ViewController.h b/examples/example_apple_metal/Shared/ViewController.h
new file mode 100644
index 0000000..a8aade1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.h
@@ -0,0 +1,20 @@
+
+#import
+#import
+#import "Renderer.h"
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface ViewController : UIViewController
+@end
+
+#else
+
+#import
+
+@interface ViewController : NSViewController
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/ViewController.mm b/examples/example_apple_metal/Shared/ViewController.mm
new file mode 100644
index 0000000..6a9236c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.mm
@@ -0,0 +1,130 @@
+
+#import "ViewController.h"
+#import "Renderer.h"
+#include "imgui.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface ViewController ()
+@property (nonatomic, readonly) MTKView *mtkView;
+@property (nonatomic, strong) Renderer *renderer;
+@end
+
+@implementation ViewController
+
+- (MTKView *)mtkView {
+ return (MTKView *)self.view;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.mtkView.device = MTLCreateSystemDefaultDevice();
+
+ if (!self.mtkView.device) {
+ NSLog(@"Metal is not supported");
+ abort();
+ }
+
+ self.renderer = [[Renderer alloc] initWithView:self.mtkView];
+
+ [self.renderer mtkView:self.mtkView drawableSizeWillChange:self.mtkView.bounds.size];
+
+ self.mtkView.delegate = self.renderer;
+
+#if TARGET_OS_OSX
+ // Add a tracking area in order to receive mouse events whenever the mouse is within the bounds of our view
+ NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:NSZeroRect
+ options:NSTrackingMouseMoved | NSTrackingInVisibleRect | NSTrackingActiveAlways
+ owner:self
+ userInfo:nil];
+ [self.view addTrackingArea:trackingArea];
+
+ // If we want to receive key events, we either need to be in the responder chain of the key view,
+ // or else we can install a local monitor. The consequence of this heavy-handed approach is that
+ // we receive events for all controls, not just ImGui widgets. If we had native controls in our
+ // window, we'd want to be much more careful than just ingesting the complete event stream, though
+ // we do make an effort to be good citizens by passing along events when ImGui doesn't want to capture.
+ NSEventMask eventMask = NSEventMaskKeyDown | NSEventMaskKeyUp | NSEventMaskFlagsChanged | NSEventTypeScrollWheel;
+ [NSEvent addLocalMonitorForEventsMatchingMask:eventMask handler:^NSEvent * _Nullable(NSEvent *event) {
+ BOOL wantsCapture = ImGui_ImplOSX_HandleEvent(event, self.view);
+ if (event.type == NSEventTypeKeyDown && wantsCapture) {
+ return nil;
+ } else {
+ return event;
+ }
+
+ }];
+
+ ImGui_ImplOSX_Init();
+#endif
+}
+
+#if TARGET_OS_OSX
+
+- (void)mouseMoved:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseDown:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseUp:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseDragged:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)scrollWheel:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+#elif TARGET_OS_IOS
+
+// This touch mapping is super cheesy/hacky. We treat any touch on the screen
+// as if it were a depressed left mouse button, and we don't bother handling
+// multitouch correctly at all. This causes the "cursor" to behave very erratically
+// when there are multiple active touches. But for demo purposes, single-touch
+// interaction actually works surprisingly well.
+- (void)updateIOWithTouchEvent:(UIEvent *)event {
+ UITouch *anyTouch = event.allTouches.anyObject;
+ CGPoint touchLocation = [anyTouch locationInView:self.view];
+ ImGuiIO &io = ImGui::GetIO();
+ io.MousePos = ImVec2(touchLocation.x, touchLocation.y);
+
+ BOOL hasActiveTouch = NO;
+ for (UITouch *touch in event.allTouches) {
+ if (touch.phase != UITouchPhaseEnded && touch.phase != UITouchPhaseCancelled) {
+ hasActiveTouch = YES;
+ break;
+ }
+ }
+ io.MouseDown[0] = hasActiveTouch;
+}
+
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+#endif
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/main.m b/examples/example_apple_metal/Shared/main.m
new file mode 100644
index 0000000..cd8468a
--- /dev/null
+++ b/examples/example_apple_metal/Shared/main.m
@@ -0,0 +1,23 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[]) {
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
+
+#else
+
+#import
+
+int main(int argc, const char * argv[]) {
+ return NSApplicationMain(argc, argv);
+}
+
+#endif
diff --git a/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj b/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..b1b6b4e
--- /dev/null
+++ b/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj
@@ -0,0 +1,541 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 50;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 8307E7CC20E9F9C900473790 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7CB20E9F9C900473790 /* ViewController.mm */; };
+ 8307E7CF20E9F9C900473790 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8307E7CD20E9F9C900473790 /* Main.storyboard */; };
+ 8307E7DE20E9F9C900473790 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7DD20E9F9C900473790 /* AppDelegate.m */; };
+ 8307E7E420E9F9C900473790 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8307E7E220E9F9C900473790 /* Main.storyboard */; };
+ 8307E7E720E9F9C900473790 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7E620E9F9C900473790 /* main.m */; };
+ 8307E7E820E9F9C900473790 /* Renderer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7BC20E9F9C700473790 /* Renderer.mm */; };
+ 8307E7E920E9F9C900473790 /* Renderer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7BC20E9F9C700473790 /* Renderer.mm */; };
+ 836D2A2E20EE208E0098E909 /* imgui_impl_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = 836D2A2D20EE208E0098E909 /* imgui_impl_osx.mm */; };
+ 836D2A3020EE4A180098E909 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 836D2A2F20EE4A180098E909 /* Default-568h@2x.png */; };
+ 836D2A3220EE4A900098E909 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 836D2A3120EE4A900098E909 /* Launch Screen.storyboard */; };
+ 83BBE9DE20EB3FFC00295997 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7E620E9F9C900473790 /* main.m */; };
+ 83BBE9DF20EB40AE00295997 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7DD20E9F9C900473790 /* AppDelegate.m */; };
+ 83BBE9E020EB42D000295997 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7CB20E9F9C900473790 /* ViewController.mm */; };
+ 83BBE9E520EB46B900295997 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E420EB46B900295997 /* Metal.framework */; };
+ 83BBE9E720EB46BD00295997 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E620EB46BD00295997 /* MetalKit.framework */; };
+ 83BBE9E920EB46C100295997 /* ModelIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E820EB46C100295997 /* ModelIO.framework */; };
+ 83BBE9EC20EB471700295997 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EA20EB471700295997 /* MetalKit.framework */; };
+ 83BBE9ED20EB471700295997 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EB20EB471700295997 /* Metal.framework */; };
+ 83BBE9EF20EB471C00295997 /* ModelIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EE20EB471C00295997 /* ModelIO.framework */; };
+ 83BBE9FE20EB54D800295997 /* imgui_impl_metal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */; };
+ 83BBE9FF20EB54D800295997 /* imgui_impl_metal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */; };
+ 83BBEA0520EB54E700295997 /* imgui_draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0120EB54E700295997 /* imgui_draw.cpp */; };
+ 83BBEA0620EB54E700295997 /* imgui_draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0120EB54E700295997 /* imgui_draw.cpp */; };
+ 83BBEA0720EB54E700295997 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0220EB54E700295997 /* imgui_demo.cpp */; };
+ 83BBEA0820EB54E700295997 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0220EB54E700295997 /* imgui_demo.cpp */; };
+ 83BBEA0920EB54E700295997 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0320EB54E700295997 /* imgui.cpp */; };
+ 83BBEA0A20EB54E700295997 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0320EB54E700295997 /* imgui.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 8307E7BB20E9F9C700473790 /* Renderer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Renderer.h; sourceTree = ""; };
+ 8307E7BC20E9F9C700473790 /* Renderer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Renderer.mm; sourceTree = ""; };
+ 8307E7C420E9F9C900473790 /* example_apple_metal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_apple_metal.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8307E7CA20E9F9C900473790 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
+ 8307E7CB20E9F9C900473790 /* ViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = ""; };
+ 8307E7CE20E9F9C900473790 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 8307E7D320E9F9C900473790 /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = ""; };
+ 8307E7DA20E9F9C900473790 /* example_apple_metal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_apple_metal.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8307E7DC20E9F9C900473790 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
+ 8307E7DD20E9F9C900473790 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
+ 8307E7E320E9F9C900473790 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 8307E7E520E9F9C900473790 /* Info-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-macOS.plist"; sourceTree = ""; };
+ 8307E7E620E9F9C900473790 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
+ 836D2A2C20EE208D0098E909 /* imgui_impl_osx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui_impl_osx.h; path = ../../imgui_impl_osx.h; sourceTree = ""; };
+ 836D2A2D20EE208E0098E909 /* imgui_impl_osx.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = imgui_impl_osx.mm; path = ../../imgui_impl_osx.mm; sourceTree = ""; };
+ 836D2A2F20EE4A180098E909 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; };
+ 836D2A3120EE4A900098E909 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; };
+ 83BBE9E420EB46B900295997 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/Metal.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9E620EB46BD00295997 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/MetalKit.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9E820EB46C100295997 /* ModelIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ModelIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/ModelIO.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9EA20EB471700295997 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; };
+ 83BBE9EB20EB471700295997 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
+ 83BBE9EE20EB471C00295997 /* ModelIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ModelIO.framework; path = System/Library/Frameworks/ModelIO.framework; sourceTree = SDKROOT; };
+ 83BBE9FC20EB54D800295997 /* imgui_impl_metal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui_impl_metal.h; path = ../../imgui_impl_metal.h; sourceTree = ""; };
+ 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = imgui_impl_metal.mm; path = ../../imgui_impl_metal.mm; sourceTree = ""; };
+ 83BBEA0020EB54E700295997 /* imgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui.h; path = ../../imgui.h; sourceTree = ""; };
+ 83BBEA0120EB54E700295997 /* imgui_draw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_draw.cpp; path = ../../imgui_draw.cpp; sourceTree = ""; };
+ 83BBEA0220EB54E700295997 /* imgui_demo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_demo.cpp; path = ../../imgui_demo.cpp; sourceTree = ""; };
+ 83BBEA0320EB54E700295997 /* imgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui.cpp; path = ../../imgui.cpp; sourceTree = ""; };
+ 83BBEA0420EB54E700295997 /* imconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imconfig.h; path = ../../imconfig.h; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8307E7C120E9F9C900473790 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 83BBE9E920EB46C100295997 /* ModelIO.framework in Frameworks */,
+ 83BBE9E720EB46BD00295997 /* MetalKit.framework in Frameworks */,
+ 83BBE9E520EB46B900295997 /* Metal.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D720E9F9C900473790 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 83BBE9EF20EB471C00295997 /* ModelIO.framework in Frameworks */,
+ 83BBE9EC20EB471700295997 /* MetalKit.framework in Frameworks */,
+ 83BBE9ED20EB471700295997 /* Metal.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 8307E7B520E9F9C700473790 = {
+ isa = PBXGroup;
+ children = (
+ 83BBE9F020EB544400295997 /* imgui */,
+ 8307E7BA20E9F9C700473790 /* Shared */,
+ 8307E7C620E9F9C900473790 /* iOS */,
+ 8307E7DB20E9F9C900473790 /* macOS */,
+ 8307E7C520E9F9C900473790 /* Products */,
+ 83BBE9E320EB46B800295997 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ 8307E7BA20E9F9C700473790 /* Shared */ = {
+ isa = PBXGroup;
+ children = (
+ 83BBE9FC20EB54D800295997 /* imgui_impl_metal.h */,
+ 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */,
+ 836D2A2C20EE208D0098E909 /* imgui_impl_osx.h */,
+ 836D2A2D20EE208E0098E909 /* imgui_impl_osx.mm */,
+ 8307E7DC20E9F9C900473790 /* AppDelegate.h */,
+ 8307E7DD20E9F9C900473790 /* AppDelegate.m */,
+ 8307E7BB20E9F9C700473790 /* Renderer.h */,
+ 8307E7BC20E9F9C700473790 /* Renderer.mm */,
+ 8307E7CA20E9F9C900473790 /* ViewController.h */,
+ 8307E7CB20E9F9C900473790 /* ViewController.mm */,
+ 8307E7E620E9F9C900473790 /* main.m */,
+ );
+ path = Shared;
+ sourceTree = "";
+ };
+ 8307E7C520E9F9C900473790 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8307E7C420E9F9C900473790 /* example_apple_metal.app */,
+ 8307E7DA20E9F9C900473790 /* example_apple_metal.app */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 8307E7C620E9F9C900473790 /* iOS */ = {
+ isa = PBXGroup;
+ children = (
+ 836D2A2F20EE4A180098E909 /* Default-568h@2x.png */,
+ 8307E7CD20E9F9C900473790 /* Main.storyboard */,
+ 8307E7D320E9F9C900473790 /* Info-iOS.plist */,
+ 836D2A3120EE4A900098E909 /* Launch Screen.storyboard */,
+ );
+ path = iOS;
+ sourceTree = "";
+ };
+ 8307E7DB20E9F9C900473790 /* macOS */ = {
+ isa = PBXGroup;
+ children = (
+ 8307E7E220E9F9C900473790 /* Main.storyboard */,
+ 8307E7E520E9F9C900473790 /* Info-macOS.plist */,
+ );
+ path = macOS;
+ sourceTree = "";
+ };
+ 83BBE9E320EB46B800295997 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 83BBE9EE20EB471C00295997 /* ModelIO.framework */,
+ 83BBE9EB20EB471700295997 /* Metal.framework */,
+ 83BBE9EA20EB471700295997 /* MetalKit.framework */,
+ 83BBE9E820EB46C100295997 /* ModelIO.framework */,
+ 83BBE9E620EB46BD00295997 /* MetalKit.framework */,
+ 83BBE9E420EB46B900295997 /* Metal.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ 83BBE9F020EB544400295997 /* imgui */ = {
+ isa = PBXGroup;
+ children = (
+ 83BBEA0420EB54E700295997 /* imconfig.h */,
+ 83BBEA0020EB54E700295997 /* imgui.h */,
+ 83BBEA0220EB54E700295997 /* imgui_demo.cpp */,
+ 83BBEA0120EB54E700295997 /* imgui_draw.cpp */,
+ 83BBEA0320EB54E700295997 /* imgui.cpp */,
+ );
+ name = imgui;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8307E7C320E9F9C900473790 /* example_apple_metal_ios */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 8307E7F020E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_ios" */;
+ buildPhases = (
+ 8307E7C020E9F9C900473790 /* Sources */,
+ 8307E7C120E9F9C900473790 /* Frameworks */,
+ 8307E7C220E9F9C900473790 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = example_apple_metal_ios;
+ productName = "imguiex iOS";
+ productReference = 8307E7C420E9F9C900473790 /* example_apple_metal.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 8307E7D920E9F9C900473790 /* example_apple_metal_macos */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 8307E7F320E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_macos" */;
+ buildPhases = (
+ 8307E7D620E9F9C900473790 /* Sources */,
+ 8307E7D720E9F9C900473790 /* Frameworks */,
+ 8307E7D820E9F9C900473790 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = example_apple_metal_macos;
+ productName = "imguiex macOS";
+ productReference = 8307E7DA20E9F9C900473790 /* example_apple_metal.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 8307E7B620E9F9C700473790 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0940;
+ ORGANIZATIONNAME = "Warren Moore";
+ TargetAttributes = {
+ 8307E7C320E9F9C900473790 = {
+ CreatedOnToolsVersion = 9.4.1;
+ };
+ 8307E7D920E9F9C900473790 = {
+ CreatedOnToolsVersion = 9.4.1;
+ };
+ };
+ };
+ buildConfigurationList = 8307E7B920E9F9C700473790 /* Build configuration list for PBXProject "example_apple_metal" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 8307E7B520E9F9C700473790;
+ productRefGroup = 8307E7C520E9F9C900473790 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8307E7C320E9F9C900473790 /* example_apple_metal_ios */,
+ 8307E7D920E9F9C900473790 /* example_apple_metal_macos */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8307E7C220E9F9C900473790 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 836D2A3220EE4A900098E909 /* Launch Screen.storyboard in Resources */,
+ 8307E7CF20E9F9C900473790 /* Main.storyboard in Resources */,
+ 836D2A3020EE4A180098E909 /* Default-568h@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D820E9F9C900473790 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8307E7E420E9F9C900473790 /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8307E7C020E9F9C900473790 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8307E7E820E9F9C900473790 /* Renderer.mm in Sources */,
+ 8307E7CC20E9F9C900473790 /* ViewController.mm in Sources */,
+ 83BBEA0520EB54E700295997 /* imgui_draw.cpp in Sources */,
+ 83BBE9DF20EB40AE00295997 /* AppDelegate.m in Sources */,
+ 83BBEA0920EB54E700295997 /* imgui.cpp in Sources */,
+ 83BBEA0720EB54E700295997 /* imgui_demo.cpp in Sources */,
+ 83BBE9FE20EB54D800295997 /* imgui_impl_metal.mm in Sources */,
+ 83BBE9DE20EB3FFC00295997 /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D620E9F9C900473790 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 83BBE9E020EB42D000295997 /* ViewController.mm in Sources */,
+ 8307E7E920E9F9C900473790 /* Renderer.mm in Sources */,
+ 83BBEA0620EB54E700295997 /* imgui_draw.cpp in Sources */,
+ 8307E7E720E9F9C900473790 /* main.m in Sources */,
+ 83BBEA0A20EB54E700295997 /* imgui.cpp in Sources */,
+ 83BBEA0820EB54E700295997 /* imgui_demo.cpp in Sources */,
+ 83BBE9FF20EB54D800295997 /* imgui_impl_metal.mm in Sources */,
+ 836D2A2E20EE208E0098E909 /* imgui_impl_osx.mm in Sources */,
+ 8307E7DE20E9F9C900473790 /* AppDelegate.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 8307E7CD20E9F9C900473790 /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8307E7CE20E9F9C900473790 /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+ 8307E7E220E9F9C900473790 /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8307E7E320E9F9C900473790 /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 8307E7EE20E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ };
+ name = Debug;
+ };
+ 8307E7EF20E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ };
+ name = Release;
+ };
+ 8307E7F120E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/iOS/Info-iOS.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-ios";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 8307E7F220E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/iOS/Info-iOS.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-ios";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 8307E7F420E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/macOS/Info-macOS.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.13;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-macos";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 8307E7F520E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/macOS/Info-macOS.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.13;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-macos";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 8307E7B920E9F9C700473790 /* Build configuration list for PBXProject "example_apple_metal" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7EE20E9F9C900473790 /* Debug */,
+ 8307E7EF20E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 8307E7F020E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_ios" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7F120E9F9C900473790 /* Debug */,
+ 8307E7F220E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 8307E7F320E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_macos" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7F420E9F9C900473790 /* Debug */,
+ 8307E7F520E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 8307E7B620E9F9C700473790 /* Project object */;
+}
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/examples/example_apple_metal/Shared/AppDelegate.h b/examples/example_apple_metal/Shared/AppDelegate.h
new file mode 100644
index 0000000..c4632b1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.h
@@ -0,0 +1,19 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+#else
+
+#import
+
+@interface AppDelegate : NSObject
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/AppDelegate.m b/examples/example_apple_metal/Shared/AppDelegate.m
new file mode 100644
index 0000000..eabb44c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.m
@@ -0,0 +1,12 @@
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+#if TARGET_OS_OSX
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
+ return YES;
+}
+#endif
+
+@end
diff --git a/examples/example_apple_metal/Shared/Renderer.h b/examples/example_apple_metal/Shared/Renderer.h
new file mode 100644
index 0000000..f324915
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.h
@@ -0,0 +1,9 @@
+
+#import
+
+@interface Renderer : NSObject
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/Renderer.mm b/examples/example_apple_metal/Shared/Renderer.mm
new file mode 100644
index 0000000..2f62ed1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.mm
@@ -0,0 +1,132 @@
+
+#import "Renderer.h"
+#import
+
+#include "imgui.h"
+#include "imgui_impl_metal.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface Renderer ()
+@property (nonatomic, strong) id device;
+@property (nonatomic, strong) id commandQueue;
+@end
+
+@implementation Renderer
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+{
+ self = [super init];
+ if(self)
+ {
+ _device = view.device;
+ _commandQueue = [_device newCommandQueue];
+
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ (void)ImGui::GetIO();
+
+ ImGui_ImplMetal_Init(_device);
+
+ ImGui::StyleColorsDark();
+ }
+
+ return self;
+}
+
+- (void)drawInMTKView:(MTKView *)view
+{
+ ImGuiIO &io = ImGui::GetIO();
+ io.DisplaySize.x = view.bounds.size.width;
+ io.DisplaySize.y = view.bounds.size.height;
+
+#if TARGET_OS_OSX
+ CGFloat framebufferScale = view.window.screen.backingScaleFactor ?: NSScreen.mainScreen.backingScaleFactor;
+#else
+ CGFloat framebufferScale = view.window.screen.scale ?: UIScreen.mainScreen.scale;
+#endif
+ io.DisplayFramebufferScale = ImVec2(framebufferScale, framebufferScale);
+
+ io.DeltaTime = 1 / float(view.preferredFramesPerSecond ?: 60);
+
+ id commandBuffer = [self.commandQueue commandBuffer];
+
+ static bool show_demo_window = true;
+ static bool show_another_window = false;
+ static float clear_color[4] = { 0.28f, 0.36f, 0.5f, 1.0f };
+
+ MTLRenderPassDescriptor *renderPassDescriptor = view.currentRenderPassDescriptor;
+ if(renderPassDescriptor != nil)
+ {
+ renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(clear_color[0], clear_color[1], clear_color[2], clear_color[3]);
+
+ // Here, you could do additional rendering work, including other passes as necessary.
+
+ id renderEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
+
+ [renderEncoder pushDebugGroup:@"Draw ImGui"];
+
+ ImGui_ImplMetal_NewFrame(renderPassDescriptor);
+#if TARGET_OS_OSX
+ ImGui_ImplOSX_NewFrame(view);
+#endif
+ ImGui::NewFrame();
+
+ {
+ static float f = 0.0f;
+ static int counter = 0;
+ ImGui::Text("Hello, world!"); // Display some text (you can use a format string too)
+ ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
+ ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
+
+ ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our windows open/close state
+ ImGui::Checkbox("Another Window", &show_another_window);
+
+ if (ImGui::Button("Button")) // Buttons return true when clicked (NB: most widgets return true when edited/activated)
+ counter++;
+ ImGui::SameLine();
+ ImGui::Text("counter = %d", counter);
+
+ ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
+ }
+
+ // 2. Show another simple window. In most cases you will use an explicit Begin/End pair to name your windows.
+ if (show_another_window)
+ {
+ ImGui::Begin("Another Window", &show_another_window);
+ ImGui::Text("Hello from another window!");
+ if (ImGui::Button("Close Me"))
+ show_another_window = false;
+ ImGui::End();
+ }
+
+ // 3. Show the ImGui demo window. Most of the sample code is in ImGui::ShowDemoWindow(). Read its code to learn more about Dear ImGui!
+ if (show_demo_window)
+ {
+ // Normally user code doesn't need/want to call this because positions are saved in .ini file anyway.
+ // Here we just want to make the demo initial state a bit more friendly!
+ ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
+ ImGui::ShowDemoWindow(&show_demo_window);
+ }
+
+ ImGui::Render();
+ ImDrawData *drawData = ImGui::GetDrawData();
+ ImGui_ImplMetal_RenderDrawData(drawData, commandBuffer, renderEncoder);
+
+ [renderEncoder popDebugGroup];
+
+ [renderEncoder endEncoding];
+
+ [commandBuffer presentDrawable:view.currentDrawable];
+ }
+
+ [commandBuffer commit];
+}
+
+- (void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size
+{
+}
+
+@end
diff --git a/examples/example_apple_metal/Shared/ViewController.h b/examples/example_apple_metal/Shared/ViewController.h
new file mode 100644
index 0000000..a8aade1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.h
@@ -0,0 +1,20 @@
+
+#import
+#import
+#import "Renderer.h"
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface ViewController : UIViewController
+@end
+
+#else
+
+#import
+
+@interface ViewController : NSViewController
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/ViewController.mm b/examples/example_apple_metal/Shared/ViewController.mm
new file mode 100644
index 0000000..6a9236c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.mm
@@ -0,0 +1,130 @@
+
+#import "ViewController.h"
+#import "Renderer.h"
+#include "imgui.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface ViewController ()
+@property (nonatomic, readonly) MTKView *mtkView;
+@property (nonatomic, strong) Renderer *renderer;
+@end
+
+@implementation ViewController
+
+- (MTKView *)mtkView {
+ return (MTKView *)self.view;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.mtkView.device = MTLCreateSystemDefaultDevice();
+
+ if (!self.mtkView.device) {
+ NSLog(@"Metal is not supported");
+ abort();
+ }
+
+ self.renderer = [[Renderer alloc] initWithView:self.mtkView];
+
+ [self.renderer mtkView:self.mtkView drawableSizeWillChange:self.mtkView.bounds.size];
+
+ self.mtkView.delegate = self.renderer;
+
+#if TARGET_OS_OSX
+ // Add a tracking area in order to receive mouse events whenever the mouse is within the bounds of our view
+ NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:NSZeroRect
+ options:NSTrackingMouseMoved | NSTrackingInVisibleRect | NSTrackingActiveAlways
+ owner:self
+ userInfo:nil];
+ [self.view addTrackingArea:trackingArea];
+
+ // If we want to receive key events, we either need to be in the responder chain of the key view,
+ // or else we can install a local monitor. The consequence of this heavy-handed approach is that
+ // we receive events for all controls, not just ImGui widgets. If we had native controls in our
+ // window, we'd want to be much more careful than just ingesting the complete event stream, though
+ // we do make an effort to be good citizens by passing along events when ImGui doesn't want to capture.
+ NSEventMask eventMask = NSEventMaskKeyDown | NSEventMaskKeyUp | NSEventMaskFlagsChanged | NSEventTypeScrollWheel;
+ [NSEvent addLocalMonitorForEventsMatchingMask:eventMask handler:^NSEvent * _Nullable(NSEvent *event) {
+ BOOL wantsCapture = ImGui_ImplOSX_HandleEvent(event, self.view);
+ if (event.type == NSEventTypeKeyDown && wantsCapture) {
+ return nil;
+ } else {
+ return event;
+ }
+
+ }];
+
+ ImGui_ImplOSX_Init();
+#endif
+}
+
+#if TARGET_OS_OSX
+
+- (void)mouseMoved:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseDown:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseUp:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseDragged:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)scrollWheel:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+#elif TARGET_OS_IOS
+
+// This touch mapping is super cheesy/hacky. We treat any touch on the screen
+// as if it were a depressed left mouse button, and we don't bother handling
+// multitouch correctly at all. This causes the "cursor" to behave very erratically
+// when there are multiple active touches. But for demo purposes, single-touch
+// interaction actually works surprisingly well.
+- (void)updateIOWithTouchEvent:(UIEvent *)event {
+ UITouch *anyTouch = event.allTouches.anyObject;
+ CGPoint touchLocation = [anyTouch locationInView:self.view];
+ ImGuiIO &io = ImGui::GetIO();
+ io.MousePos = ImVec2(touchLocation.x, touchLocation.y);
+
+ BOOL hasActiveTouch = NO;
+ for (UITouch *touch in event.allTouches) {
+ if (touch.phase != UITouchPhaseEnded && touch.phase != UITouchPhaseCancelled) {
+ hasActiveTouch = YES;
+ break;
+ }
+ }
+ io.MouseDown[0] = hasActiveTouch;
+}
+
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+#endif
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/main.m b/examples/example_apple_metal/Shared/main.m
new file mode 100644
index 0000000..cd8468a
--- /dev/null
+++ b/examples/example_apple_metal/Shared/main.m
@@ -0,0 +1,23 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[]) {
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
+
+#else
+
+#import
+
+int main(int argc, const char * argv[]) {
+ return NSApplicationMain(argc, argv);
+}
+
+#endif
diff --git a/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj b/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..b1b6b4e
--- /dev/null
+++ b/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj
@@ -0,0 +1,541 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 50;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 8307E7CC20E9F9C900473790 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7CB20E9F9C900473790 /* ViewController.mm */; };
+ 8307E7CF20E9F9C900473790 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8307E7CD20E9F9C900473790 /* Main.storyboard */; };
+ 8307E7DE20E9F9C900473790 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7DD20E9F9C900473790 /* AppDelegate.m */; };
+ 8307E7E420E9F9C900473790 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8307E7E220E9F9C900473790 /* Main.storyboard */; };
+ 8307E7E720E9F9C900473790 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7E620E9F9C900473790 /* main.m */; };
+ 8307E7E820E9F9C900473790 /* Renderer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7BC20E9F9C700473790 /* Renderer.mm */; };
+ 8307E7E920E9F9C900473790 /* Renderer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7BC20E9F9C700473790 /* Renderer.mm */; };
+ 836D2A2E20EE208E0098E909 /* imgui_impl_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = 836D2A2D20EE208E0098E909 /* imgui_impl_osx.mm */; };
+ 836D2A3020EE4A180098E909 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 836D2A2F20EE4A180098E909 /* Default-568h@2x.png */; };
+ 836D2A3220EE4A900098E909 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 836D2A3120EE4A900098E909 /* Launch Screen.storyboard */; };
+ 83BBE9DE20EB3FFC00295997 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7E620E9F9C900473790 /* main.m */; };
+ 83BBE9DF20EB40AE00295997 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7DD20E9F9C900473790 /* AppDelegate.m */; };
+ 83BBE9E020EB42D000295997 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7CB20E9F9C900473790 /* ViewController.mm */; };
+ 83BBE9E520EB46B900295997 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E420EB46B900295997 /* Metal.framework */; };
+ 83BBE9E720EB46BD00295997 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E620EB46BD00295997 /* MetalKit.framework */; };
+ 83BBE9E920EB46C100295997 /* ModelIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E820EB46C100295997 /* ModelIO.framework */; };
+ 83BBE9EC20EB471700295997 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EA20EB471700295997 /* MetalKit.framework */; };
+ 83BBE9ED20EB471700295997 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EB20EB471700295997 /* Metal.framework */; };
+ 83BBE9EF20EB471C00295997 /* ModelIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EE20EB471C00295997 /* ModelIO.framework */; };
+ 83BBE9FE20EB54D800295997 /* imgui_impl_metal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */; };
+ 83BBE9FF20EB54D800295997 /* imgui_impl_metal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */; };
+ 83BBEA0520EB54E700295997 /* imgui_draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0120EB54E700295997 /* imgui_draw.cpp */; };
+ 83BBEA0620EB54E700295997 /* imgui_draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0120EB54E700295997 /* imgui_draw.cpp */; };
+ 83BBEA0720EB54E700295997 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0220EB54E700295997 /* imgui_demo.cpp */; };
+ 83BBEA0820EB54E700295997 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0220EB54E700295997 /* imgui_demo.cpp */; };
+ 83BBEA0920EB54E700295997 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0320EB54E700295997 /* imgui.cpp */; };
+ 83BBEA0A20EB54E700295997 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0320EB54E700295997 /* imgui.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 8307E7BB20E9F9C700473790 /* Renderer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Renderer.h; sourceTree = ""; };
+ 8307E7BC20E9F9C700473790 /* Renderer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Renderer.mm; sourceTree = ""; };
+ 8307E7C420E9F9C900473790 /* example_apple_metal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_apple_metal.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8307E7CA20E9F9C900473790 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
+ 8307E7CB20E9F9C900473790 /* ViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = ""; };
+ 8307E7CE20E9F9C900473790 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 8307E7D320E9F9C900473790 /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = ""; };
+ 8307E7DA20E9F9C900473790 /* example_apple_metal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_apple_metal.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8307E7DC20E9F9C900473790 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
+ 8307E7DD20E9F9C900473790 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
+ 8307E7E320E9F9C900473790 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 8307E7E520E9F9C900473790 /* Info-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-macOS.plist"; sourceTree = ""; };
+ 8307E7E620E9F9C900473790 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
+ 836D2A2C20EE208D0098E909 /* imgui_impl_osx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui_impl_osx.h; path = ../../imgui_impl_osx.h; sourceTree = ""; };
+ 836D2A2D20EE208E0098E909 /* imgui_impl_osx.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = imgui_impl_osx.mm; path = ../../imgui_impl_osx.mm; sourceTree = ""; };
+ 836D2A2F20EE4A180098E909 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; };
+ 836D2A3120EE4A900098E909 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; };
+ 83BBE9E420EB46B900295997 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/Metal.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9E620EB46BD00295997 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/MetalKit.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9E820EB46C100295997 /* ModelIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ModelIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/ModelIO.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9EA20EB471700295997 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; };
+ 83BBE9EB20EB471700295997 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
+ 83BBE9EE20EB471C00295997 /* ModelIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ModelIO.framework; path = System/Library/Frameworks/ModelIO.framework; sourceTree = SDKROOT; };
+ 83BBE9FC20EB54D800295997 /* imgui_impl_metal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui_impl_metal.h; path = ../../imgui_impl_metal.h; sourceTree = ""; };
+ 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = imgui_impl_metal.mm; path = ../../imgui_impl_metal.mm; sourceTree = ""; };
+ 83BBEA0020EB54E700295997 /* imgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui.h; path = ../../imgui.h; sourceTree = ""; };
+ 83BBEA0120EB54E700295997 /* imgui_draw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_draw.cpp; path = ../../imgui_draw.cpp; sourceTree = ""; };
+ 83BBEA0220EB54E700295997 /* imgui_demo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_demo.cpp; path = ../../imgui_demo.cpp; sourceTree = ""; };
+ 83BBEA0320EB54E700295997 /* imgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui.cpp; path = ../../imgui.cpp; sourceTree = ""; };
+ 83BBEA0420EB54E700295997 /* imconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imconfig.h; path = ../../imconfig.h; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8307E7C120E9F9C900473790 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 83BBE9E920EB46C100295997 /* ModelIO.framework in Frameworks */,
+ 83BBE9E720EB46BD00295997 /* MetalKit.framework in Frameworks */,
+ 83BBE9E520EB46B900295997 /* Metal.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D720E9F9C900473790 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 83BBE9EF20EB471C00295997 /* ModelIO.framework in Frameworks */,
+ 83BBE9EC20EB471700295997 /* MetalKit.framework in Frameworks */,
+ 83BBE9ED20EB471700295997 /* Metal.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 8307E7B520E9F9C700473790 = {
+ isa = PBXGroup;
+ children = (
+ 83BBE9F020EB544400295997 /* imgui */,
+ 8307E7BA20E9F9C700473790 /* Shared */,
+ 8307E7C620E9F9C900473790 /* iOS */,
+ 8307E7DB20E9F9C900473790 /* macOS */,
+ 8307E7C520E9F9C900473790 /* Products */,
+ 83BBE9E320EB46B800295997 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ 8307E7BA20E9F9C700473790 /* Shared */ = {
+ isa = PBXGroup;
+ children = (
+ 83BBE9FC20EB54D800295997 /* imgui_impl_metal.h */,
+ 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */,
+ 836D2A2C20EE208D0098E909 /* imgui_impl_osx.h */,
+ 836D2A2D20EE208E0098E909 /* imgui_impl_osx.mm */,
+ 8307E7DC20E9F9C900473790 /* AppDelegate.h */,
+ 8307E7DD20E9F9C900473790 /* AppDelegate.m */,
+ 8307E7BB20E9F9C700473790 /* Renderer.h */,
+ 8307E7BC20E9F9C700473790 /* Renderer.mm */,
+ 8307E7CA20E9F9C900473790 /* ViewController.h */,
+ 8307E7CB20E9F9C900473790 /* ViewController.mm */,
+ 8307E7E620E9F9C900473790 /* main.m */,
+ );
+ path = Shared;
+ sourceTree = "";
+ };
+ 8307E7C520E9F9C900473790 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8307E7C420E9F9C900473790 /* example_apple_metal.app */,
+ 8307E7DA20E9F9C900473790 /* example_apple_metal.app */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 8307E7C620E9F9C900473790 /* iOS */ = {
+ isa = PBXGroup;
+ children = (
+ 836D2A2F20EE4A180098E909 /* Default-568h@2x.png */,
+ 8307E7CD20E9F9C900473790 /* Main.storyboard */,
+ 8307E7D320E9F9C900473790 /* Info-iOS.plist */,
+ 836D2A3120EE4A900098E909 /* Launch Screen.storyboard */,
+ );
+ path = iOS;
+ sourceTree = "";
+ };
+ 8307E7DB20E9F9C900473790 /* macOS */ = {
+ isa = PBXGroup;
+ children = (
+ 8307E7E220E9F9C900473790 /* Main.storyboard */,
+ 8307E7E520E9F9C900473790 /* Info-macOS.plist */,
+ );
+ path = macOS;
+ sourceTree = "";
+ };
+ 83BBE9E320EB46B800295997 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 83BBE9EE20EB471C00295997 /* ModelIO.framework */,
+ 83BBE9EB20EB471700295997 /* Metal.framework */,
+ 83BBE9EA20EB471700295997 /* MetalKit.framework */,
+ 83BBE9E820EB46C100295997 /* ModelIO.framework */,
+ 83BBE9E620EB46BD00295997 /* MetalKit.framework */,
+ 83BBE9E420EB46B900295997 /* Metal.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ 83BBE9F020EB544400295997 /* imgui */ = {
+ isa = PBXGroup;
+ children = (
+ 83BBEA0420EB54E700295997 /* imconfig.h */,
+ 83BBEA0020EB54E700295997 /* imgui.h */,
+ 83BBEA0220EB54E700295997 /* imgui_demo.cpp */,
+ 83BBEA0120EB54E700295997 /* imgui_draw.cpp */,
+ 83BBEA0320EB54E700295997 /* imgui.cpp */,
+ );
+ name = imgui;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8307E7C320E9F9C900473790 /* example_apple_metal_ios */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 8307E7F020E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_ios" */;
+ buildPhases = (
+ 8307E7C020E9F9C900473790 /* Sources */,
+ 8307E7C120E9F9C900473790 /* Frameworks */,
+ 8307E7C220E9F9C900473790 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = example_apple_metal_ios;
+ productName = "imguiex iOS";
+ productReference = 8307E7C420E9F9C900473790 /* example_apple_metal.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 8307E7D920E9F9C900473790 /* example_apple_metal_macos */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 8307E7F320E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_macos" */;
+ buildPhases = (
+ 8307E7D620E9F9C900473790 /* Sources */,
+ 8307E7D720E9F9C900473790 /* Frameworks */,
+ 8307E7D820E9F9C900473790 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = example_apple_metal_macos;
+ productName = "imguiex macOS";
+ productReference = 8307E7DA20E9F9C900473790 /* example_apple_metal.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 8307E7B620E9F9C700473790 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0940;
+ ORGANIZATIONNAME = "Warren Moore";
+ TargetAttributes = {
+ 8307E7C320E9F9C900473790 = {
+ CreatedOnToolsVersion = 9.4.1;
+ };
+ 8307E7D920E9F9C900473790 = {
+ CreatedOnToolsVersion = 9.4.1;
+ };
+ };
+ };
+ buildConfigurationList = 8307E7B920E9F9C700473790 /* Build configuration list for PBXProject "example_apple_metal" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 8307E7B520E9F9C700473790;
+ productRefGroup = 8307E7C520E9F9C900473790 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8307E7C320E9F9C900473790 /* example_apple_metal_ios */,
+ 8307E7D920E9F9C900473790 /* example_apple_metal_macos */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8307E7C220E9F9C900473790 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 836D2A3220EE4A900098E909 /* Launch Screen.storyboard in Resources */,
+ 8307E7CF20E9F9C900473790 /* Main.storyboard in Resources */,
+ 836D2A3020EE4A180098E909 /* Default-568h@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D820E9F9C900473790 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8307E7E420E9F9C900473790 /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8307E7C020E9F9C900473790 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8307E7E820E9F9C900473790 /* Renderer.mm in Sources */,
+ 8307E7CC20E9F9C900473790 /* ViewController.mm in Sources */,
+ 83BBEA0520EB54E700295997 /* imgui_draw.cpp in Sources */,
+ 83BBE9DF20EB40AE00295997 /* AppDelegate.m in Sources */,
+ 83BBEA0920EB54E700295997 /* imgui.cpp in Sources */,
+ 83BBEA0720EB54E700295997 /* imgui_demo.cpp in Sources */,
+ 83BBE9FE20EB54D800295997 /* imgui_impl_metal.mm in Sources */,
+ 83BBE9DE20EB3FFC00295997 /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D620E9F9C900473790 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 83BBE9E020EB42D000295997 /* ViewController.mm in Sources */,
+ 8307E7E920E9F9C900473790 /* Renderer.mm in Sources */,
+ 83BBEA0620EB54E700295997 /* imgui_draw.cpp in Sources */,
+ 8307E7E720E9F9C900473790 /* main.m in Sources */,
+ 83BBEA0A20EB54E700295997 /* imgui.cpp in Sources */,
+ 83BBEA0820EB54E700295997 /* imgui_demo.cpp in Sources */,
+ 83BBE9FF20EB54D800295997 /* imgui_impl_metal.mm in Sources */,
+ 836D2A2E20EE208E0098E909 /* imgui_impl_osx.mm in Sources */,
+ 8307E7DE20E9F9C900473790 /* AppDelegate.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 8307E7CD20E9F9C900473790 /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8307E7CE20E9F9C900473790 /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+ 8307E7E220E9F9C900473790 /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8307E7E320E9F9C900473790 /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 8307E7EE20E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ };
+ name = Debug;
+ };
+ 8307E7EF20E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ };
+ name = Release;
+ };
+ 8307E7F120E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/iOS/Info-iOS.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-ios";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 8307E7F220E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/iOS/Info-iOS.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-ios";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 8307E7F420E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/macOS/Info-macOS.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.13;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-macos";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 8307E7F520E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/macOS/Info-macOS.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.13;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-macos";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 8307E7B920E9F9C700473790 /* Build configuration list for PBXProject "example_apple_metal" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7EE20E9F9C900473790 /* Debug */,
+ 8307E7EF20E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 8307E7F020E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_ios" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7F120E9F9C900473790 /* Debug */,
+ 8307E7F220E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 8307E7F320E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_macos" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7F420E9F9C900473790 /* Debug */,
+ 8307E7F520E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 8307E7B620E9F9C700473790 /* Project object */;
+}
diff --git a/examples/example_apple_metal/iOS/Base.lproj/Main.storyboard b/examples/example_apple_metal/iOS/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..24a4009
--- /dev/null
+++ b/examples/example_apple_metal/iOS/Base.lproj/Main.storyboard
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d2482ff..aa7af66 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -47,6 +47,10 @@
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
- Fixed a include build issue for Cygwin in non-POSIX (Win32) mode. (#1917, #1319, #276)
+ - Examples: Metal: Added Metal rendering backend. (#1929, #1873) [@warrenm]
+ - Examples: OSX: Added early raw OSX platform backend. (#1873) [@pagghiu, @itamago, @ocornut]
+ - Examples: Added mac OSX & iOS + Metal example in example_apple_metal/. (#1929, #1873) [@warrenm]
+ - Examples: Added mac OSX + OpenGL2 example in example_apple_opengl2/. (#1873)
- Examples: Win32, Glfw, SDL: Added support for the ImGuiMouseCursor_Hand cursor.
@@ -99,6 +103,7 @@
- SliderFloat(): When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)
- ImFontConfig: Added GlyphMinAdvanceX/GlyphMaxAdvanceX settings useful to make a font appears monospaced, particularly useful for icon fonts. (#1869)
- ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut]
+ - Examples: OSX: Added imgui_impl_osx.mm binding to be used along with e.g. imgui_impl_opengl2.cpp. (#281, #1870) [@pagghiu, @itamago, @ocornut]
- Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
diff --git a/README.md b/README.md
index 953d5ad..2abaf03 100644
--- a/README.md
+++ b/README.md
@@ -125,10 +125,9 @@
- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui)
Frameworks:
-- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, Metal, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
+- Platform: GLFW, SDL, Win32, OSX, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples)
-- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx)
- Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336)
- Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281)
- Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421)
@@ -170,6 +169,7 @@
[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 onward)
+
[Gallery Part 6](https://github.com/ocornut/imgui/issues/1902) (June 2018 onward)
Also see the [Mega screenshots](https://github.com/ocornut/imgui/issues/1273) for an idea of the available features.
Various tools
diff --git a/examples/README.txt b/examples/README.txt
index 405768c..766729d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -103,6 +103,7 @@
List of Platforms Bindings in this repository:
imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/
+ imgui_impl_osx.mm ; macOS native API
imgui_impl_sdl.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org
imgui_impl_win32.cpp ; Windows native API (Windows)
imgui_impl_freeglut.cpp ; FreeGLUT (if you really miss the 90's)
@@ -112,7 +113,8 @@
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
- imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_dx12.cpp ; DirectX12
+ imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@@ -143,6 +145,7 @@
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
+ - Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@@ -207,10 +210,19 @@
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
+example_apple_metal/
+ OSX & iOS + Metal.
+ It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+ = game template + imgui_impl_osx.mm + imgui_impl_metal.mm
+
+example_apple_opengl2/
+ OSX Cocoa + OpenGL2.
+ = main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp
+
example_apple/
OSX & iOS example + OpenGL2.
THIS EXAMPLE HAS NOT BEEN MAINTAINED PROPERLY AND NEEDS A MAINTAINER.
- Consider using the example_glfw_opengl3/ instead.
+ Consider using the example_glfw_opengl3/ or example_osx_opengl2/ example instead.
On iOS, Using Synergy to access keyboard/mouse data from server computer.
Synergy keyboard integration is rather hacky.
diff --git a/examples/example_apple/.gitignore b/examples/example_apple/.gitignore
deleted file mode 100644
index 8feda89..0000000
--- a/examples/example_apple/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.DS_Store
-imguiex.xcodeproj/project.xcworkspace/
-imguiex.xcodeproj/xcuserdata/
\ No newline at end of file
diff --git a/examples/example_apple_metal/README.md b/examples/example_apple_metal/README.md
new file mode 100644
index 0000000..d43b492
--- /dev/null
+++ b/examples/example_apple_metal/README.md
@@ -0,0 +1,6 @@
+# iOS / OSX Metal example
+
+## Introduction
+
+This example shows how to render ImGui with Metal. It is based on the cross-platform game template provided with Xcode as of Xcode 9.
+
diff --git a/examples/example_apple_metal/Shared/AppDelegate.h b/examples/example_apple_metal/Shared/AppDelegate.h
new file mode 100644
index 0000000..c4632b1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.h
@@ -0,0 +1,19 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface AppDelegate : UIResponder
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+#else
+
+#import
+
+@interface AppDelegate : NSObject
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/AppDelegate.m b/examples/example_apple_metal/Shared/AppDelegate.m
new file mode 100644
index 0000000..eabb44c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/AppDelegate.m
@@ -0,0 +1,12 @@
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+#if TARGET_OS_OSX
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
+ return YES;
+}
+#endif
+
+@end
diff --git a/examples/example_apple_metal/Shared/Renderer.h b/examples/example_apple_metal/Shared/Renderer.h
new file mode 100644
index 0000000..f324915
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.h
@@ -0,0 +1,9 @@
+
+#import
+
+@interface Renderer : NSObject
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/Renderer.mm b/examples/example_apple_metal/Shared/Renderer.mm
new file mode 100644
index 0000000..2f62ed1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/Renderer.mm
@@ -0,0 +1,132 @@
+
+#import "Renderer.h"
+#import
+
+#include "imgui.h"
+#include "imgui_impl_metal.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface Renderer ()
+@property (nonatomic, strong) id device;
+@property (nonatomic, strong) id commandQueue;
+@end
+
+@implementation Renderer
+
+-(nonnull instancetype)initWithView:(nonnull MTKView *)view;
+{
+ self = [super init];
+ if(self)
+ {
+ _device = view.device;
+ _commandQueue = [_device newCommandQueue];
+
+ IMGUI_CHECKVERSION();
+ ImGui::CreateContext();
+ (void)ImGui::GetIO();
+
+ ImGui_ImplMetal_Init(_device);
+
+ ImGui::StyleColorsDark();
+ }
+
+ return self;
+}
+
+- (void)drawInMTKView:(MTKView *)view
+{
+ ImGuiIO &io = ImGui::GetIO();
+ io.DisplaySize.x = view.bounds.size.width;
+ io.DisplaySize.y = view.bounds.size.height;
+
+#if TARGET_OS_OSX
+ CGFloat framebufferScale = view.window.screen.backingScaleFactor ?: NSScreen.mainScreen.backingScaleFactor;
+#else
+ CGFloat framebufferScale = view.window.screen.scale ?: UIScreen.mainScreen.scale;
+#endif
+ io.DisplayFramebufferScale = ImVec2(framebufferScale, framebufferScale);
+
+ io.DeltaTime = 1 / float(view.preferredFramesPerSecond ?: 60);
+
+ id commandBuffer = [self.commandQueue commandBuffer];
+
+ static bool show_demo_window = true;
+ static bool show_another_window = false;
+ static float clear_color[4] = { 0.28f, 0.36f, 0.5f, 1.0f };
+
+ MTLRenderPassDescriptor *renderPassDescriptor = view.currentRenderPassDescriptor;
+ if(renderPassDescriptor != nil)
+ {
+ renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(clear_color[0], clear_color[1], clear_color[2], clear_color[3]);
+
+ // Here, you could do additional rendering work, including other passes as necessary.
+
+ id renderEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
+
+ [renderEncoder pushDebugGroup:@"Draw ImGui"];
+
+ ImGui_ImplMetal_NewFrame(renderPassDescriptor);
+#if TARGET_OS_OSX
+ ImGui_ImplOSX_NewFrame(view);
+#endif
+ ImGui::NewFrame();
+
+ {
+ static float f = 0.0f;
+ static int counter = 0;
+ ImGui::Text("Hello, world!"); // Display some text (you can use a format string too)
+ ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
+ ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
+
+ ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our windows open/close state
+ ImGui::Checkbox("Another Window", &show_another_window);
+
+ if (ImGui::Button("Button")) // Buttons return true when clicked (NB: most widgets return true when edited/activated)
+ counter++;
+ ImGui::SameLine();
+ ImGui::Text("counter = %d", counter);
+
+ ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
+ }
+
+ // 2. Show another simple window. In most cases you will use an explicit Begin/End pair to name your windows.
+ if (show_another_window)
+ {
+ ImGui::Begin("Another Window", &show_another_window);
+ ImGui::Text("Hello from another window!");
+ if (ImGui::Button("Close Me"))
+ show_another_window = false;
+ ImGui::End();
+ }
+
+ // 3. Show the ImGui demo window. Most of the sample code is in ImGui::ShowDemoWindow(). Read its code to learn more about Dear ImGui!
+ if (show_demo_window)
+ {
+ // Normally user code doesn't need/want to call this because positions are saved in .ini file anyway.
+ // Here we just want to make the demo initial state a bit more friendly!
+ ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
+ ImGui::ShowDemoWindow(&show_demo_window);
+ }
+
+ ImGui::Render();
+ ImDrawData *drawData = ImGui::GetDrawData();
+ ImGui_ImplMetal_RenderDrawData(drawData, commandBuffer, renderEncoder);
+
+ [renderEncoder popDebugGroup];
+
+ [renderEncoder endEncoding];
+
+ [commandBuffer presentDrawable:view.currentDrawable];
+ }
+
+ [commandBuffer commit];
+}
+
+- (void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size
+{
+}
+
+@end
diff --git a/examples/example_apple_metal/Shared/ViewController.h b/examples/example_apple_metal/Shared/ViewController.h
new file mode 100644
index 0000000..a8aade1
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.h
@@ -0,0 +1,20 @@
+
+#import
+#import
+#import "Renderer.h"
+
+#if TARGET_OS_IPHONE
+
+#import
+
+@interface ViewController : UIViewController
+@end
+
+#else
+
+#import
+
+@interface ViewController : NSViewController
+@end
+
+#endif
diff --git a/examples/example_apple_metal/Shared/ViewController.mm b/examples/example_apple_metal/Shared/ViewController.mm
new file mode 100644
index 0000000..6a9236c
--- /dev/null
+++ b/examples/example_apple_metal/Shared/ViewController.mm
@@ -0,0 +1,130 @@
+
+#import "ViewController.h"
+#import "Renderer.h"
+#include "imgui.h"
+
+#if TARGET_OS_OSX
+#include "imgui_impl_osx.h"
+#endif
+
+@interface ViewController ()
+@property (nonatomic, readonly) MTKView *mtkView;
+@property (nonatomic, strong) Renderer *renderer;
+@end
+
+@implementation ViewController
+
+- (MTKView *)mtkView {
+ return (MTKView *)self.view;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ self.mtkView.device = MTLCreateSystemDefaultDevice();
+
+ if (!self.mtkView.device) {
+ NSLog(@"Metal is not supported");
+ abort();
+ }
+
+ self.renderer = [[Renderer alloc] initWithView:self.mtkView];
+
+ [self.renderer mtkView:self.mtkView drawableSizeWillChange:self.mtkView.bounds.size];
+
+ self.mtkView.delegate = self.renderer;
+
+#if TARGET_OS_OSX
+ // Add a tracking area in order to receive mouse events whenever the mouse is within the bounds of our view
+ NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:NSZeroRect
+ options:NSTrackingMouseMoved | NSTrackingInVisibleRect | NSTrackingActiveAlways
+ owner:self
+ userInfo:nil];
+ [self.view addTrackingArea:trackingArea];
+
+ // If we want to receive key events, we either need to be in the responder chain of the key view,
+ // or else we can install a local monitor. The consequence of this heavy-handed approach is that
+ // we receive events for all controls, not just ImGui widgets. If we had native controls in our
+ // window, we'd want to be much more careful than just ingesting the complete event stream, though
+ // we do make an effort to be good citizens by passing along events when ImGui doesn't want to capture.
+ NSEventMask eventMask = NSEventMaskKeyDown | NSEventMaskKeyUp | NSEventMaskFlagsChanged | NSEventTypeScrollWheel;
+ [NSEvent addLocalMonitorForEventsMatchingMask:eventMask handler:^NSEvent * _Nullable(NSEvent *event) {
+ BOOL wantsCapture = ImGui_ImplOSX_HandleEvent(event, self.view);
+ if (event.type == NSEventTypeKeyDown && wantsCapture) {
+ return nil;
+ } else {
+ return event;
+ }
+
+ }];
+
+ ImGui_ImplOSX_Init();
+#endif
+}
+
+#if TARGET_OS_OSX
+
+- (void)mouseMoved:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseDown:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseUp:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)mouseDragged:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+- (void)scrollWheel:(NSEvent *)event {
+ ImGui_ImplOSX_HandleEvent(event, self.view);
+}
+
+#elif TARGET_OS_IOS
+
+// This touch mapping is super cheesy/hacky. We treat any touch on the screen
+// as if it were a depressed left mouse button, and we don't bother handling
+// multitouch correctly at all. This causes the "cursor" to behave very erratically
+// when there are multiple active touches. But for demo purposes, single-touch
+// interaction actually works surprisingly well.
+- (void)updateIOWithTouchEvent:(UIEvent *)event {
+ UITouch *anyTouch = event.allTouches.anyObject;
+ CGPoint touchLocation = [anyTouch locationInView:self.view];
+ ImGuiIO &io = ImGui::GetIO();
+ io.MousePos = ImVec2(touchLocation.x, touchLocation.y);
+
+ BOOL hasActiveTouch = NO;
+ for (UITouch *touch in event.allTouches) {
+ if (touch.phase != UITouchPhaseEnded && touch.phase != UITouchPhaseCancelled) {
+ hasActiveTouch = YES;
+ break;
+ }
+ }
+ io.MouseDown[0] = hasActiveTouch;
+}
+
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
+ [self updateIOWithTouchEvent:event];
+}
+
+#endif
+
+@end
+
diff --git a/examples/example_apple_metal/Shared/main.m b/examples/example_apple_metal/Shared/main.m
new file mode 100644
index 0000000..cd8468a
--- /dev/null
+++ b/examples/example_apple_metal/Shared/main.m
@@ -0,0 +1,23 @@
+
+#import
+
+#if TARGET_OS_IPHONE
+
+#import
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[]) {
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
+
+#else
+
+#import
+
+int main(int argc, const char * argv[]) {
+ return NSApplicationMain(argc, argv);
+}
+
+#endif
diff --git a/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj b/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..b1b6b4e
--- /dev/null
+++ b/examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj
@@ -0,0 +1,541 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 50;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 8307E7CC20E9F9C900473790 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7CB20E9F9C900473790 /* ViewController.mm */; };
+ 8307E7CF20E9F9C900473790 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8307E7CD20E9F9C900473790 /* Main.storyboard */; };
+ 8307E7DE20E9F9C900473790 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7DD20E9F9C900473790 /* AppDelegate.m */; };
+ 8307E7E420E9F9C900473790 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8307E7E220E9F9C900473790 /* Main.storyboard */; };
+ 8307E7E720E9F9C900473790 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7E620E9F9C900473790 /* main.m */; };
+ 8307E7E820E9F9C900473790 /* Renderer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7BC20E9F9C700473790 /* Renderer.mm */; };
+ 8307E7E920E9F9C900473790 /* Renderer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7BC20E9F9C700473790 /* Renderer.mm */; };
+ 836D2A2E20EE208E0098E909 /* imgui_impl_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = 836D2A2D20EE208E0098E909 /* imgui_impl_osx.mm */; };
+ 836D2A3020EE4A180098E909 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 836D2A2F20EE4A180098E909 /* Default-568h@2x.png */; };
+ 836D2A3220EE4A900098E909 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 836D2A3120EE4A900098E909 /* Launch Screen.storyboard */; };
+ 83BBE9DE20EB3FFC00295997 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7E620E9F9C900473790 /* main.m */; };
+ 83BBE9DF20EB40AE00295997 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7DD20E9F9C900473790 /* AppDelegate.m */; };
+ 83BBE9E020EB42D000295997 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8307E7CB20E9F9C900473790 /* ViewController.mm */; };
+ 83BBE9E520EB46B900295997 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E420EB46B900295997 /* Metal.framework */; };
+ 83BBE9E720EB46BD00295997 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E620EB46BD00295997 /* MetalKit.framework */; };
+ 83BBE9E920EB46C100295997 /* ModelIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9E820EB46C100295997 /* ModelIO.framework */; };
+ 83BBE9EC20EB471700295997 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EA20EB471700295997 /* MetalKit.framework */; };
+ 83BBE9ED20EB471700295997 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EB20EB471700295997 /* Metal.framework */; };
+ 83BBE9EF20EB471C00295997 /* ModelIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83BBE9EE20EB471C00295997 /* ModelIO.framework */; };
+ 83BBE9FE20EB54D800295997 /* imgui_impl_metal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */; };
+ 83BBE9FF20EB54D800295997 /* imgui_impl_metal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */; };
+ 83BBEA0520EB54E700295997 /* imgui_draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0120EB54E700295997 /* imgui_draw.cpp */; };
+ 83BBEA0620EB54E700295997 /* imgui_draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0120EB54E700295997 /* imgui_draw.cpp */; };
+ 83BBEA0720EB54E700295997 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0220EB54E700295997 /* imgui_demo.cpp */; };
+ 83BBEA0820EB54E700295997 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0220EB54E700295997 /* imgui_demo.cpp */; };
+ 83BBEA0920EB54E700295997 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0320EB54E700295997 /* imgui.cpp */; };
+ 83BBEA0A20EB54E700295997 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BBEA0320EB54E700295997 /* imgui.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 8307E7BB20E9F9C700473790 /* Renderer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Renderer.h; sourceTree = ""; };
+ 8307E7BC20E9F9C700473790 /* Renderer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Renderer.mm; sourceTree = ""; };
+ 8307E7C420E9F9C900473790 /* example_apple_metal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_apple_metal.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8307E7CA20E9F9C900473790 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
+ 8307E7CB20E9F9C900473790 /* ViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = ""; };
+ 8307E7CE20E9F9C900473790 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 8307E7D320E9F9C900473790 /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = ""; };
+ 8307E7DA20E9F9C900473790 /* example_apple_metal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_apple_metal.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8307E7DC20E9F9C900473790 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
+ 8307E7DD20E9F9C900473790 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
+ 8307E7E320E9F9C900473790 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 8307E7E520E9F9C900473790 /* Info-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-macOS.plist"; sourceTree = ""; };
+ 8307E7E620E9F9C900473790 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
+ 836D2A2C20EE208D0098E909 /* imgui_impl_osx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui_impl_osx.h; path = ../../imgui_impl_osx.h; sourceTree = ""; };
+ 836D2A2D20EE208E0098E909 /* imgui_impl_osx.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = imgui_impl_osx.mm; path = ../../imgui_impl_osx.mm; sourceTree = ""; };
+ 836D2A2F20EE4A180098E909 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; };
+ 836D2A3120EE4A900098E909 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; };
+ 83BBE9E420EB46B900295997 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/Metal.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9E620EB46BD00295997 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/MetalKit.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9E820EB46C100295997 /* ModelIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ModelIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/ModelIO.framework; sourceTree = DEVELOPER_DIR; };
+ 83BBE9EA20EB471700295997 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; };
+ 83BBE9EB20EB471700295997 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
+ 83BBE9EE20EB471C00295997 /* ModelIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ModelIO.framework; path = System/Library/Frameworks/ModelIO.framework; sourceTree = SDKROOT; };
+ 83BBE9FC20EB54D800295997 /* imgui_impl_metal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui_impl_metal.h; path = ../../imgui_impl_metal.h; sourceTree = ""; };
+ 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = imgui_impl_metal.mm; path = ../../imgui_impl_metal.mm; sourceTree = ""; };
+ 83BBEA0020EB54E700295997 /* imgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui.h; path = ../../imgui.h; sourceTree = ""; };
+ 83BBEA0120EB54E700295997 /* imgui_draw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_draw.cpp; path = ../../imgui_draw.cpp; sourceTree = ""; };
+ 83BBEA0220EB54E700295997 /* imgui_demo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui_demo.cpp; path = ../../imgui_demo.cpp; sourceTree = ""; };
+ 83BBEA0320EB54E700295997 /* imgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui.cpp; path = ../../imgui.cpp; sourceTree = ""; };
+ 83BBEA0420EB54E700295997 /* imconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imconfig.h; path = ../../imconfig.h; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8307E7C120E9F9C900473790 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 83BBE9E920EB46C100295997 /* ModelIO.framework in Frameworks */,
+ 83BBE9E720EB46BD00295997 /* MetalKit.framework in Frameworks */,
+ 83BBE9E520EB46B900295997 /* Metal.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D720E9F9C900473790 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 83BBE9EF20EB471C00295997 /* ModelIO.framework in Frameworks */,
+ 83BBE9EC20EB471700295997 /* MetalKit.framework in Frameworks */,
+ 83BBE9ED20EB471700295997 /* Metal.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 8307E7B520E9F9C700473790 = {
+ isa = PBXGroup;
+ children = (
+ 83BBE9F020EB544400295997 /* imgui */,
+ 8307E7BA20E9F9C700473790 /* Shared */,
+ 8307E7C620E9F9C900473790 /* iOS */,
+ 8307E7DB20E9F9C900473790 /* macOS */,
+ 8307E7C520E9F9C900473790 /* Products */,
+ 83BBE9E320EB46B800295997 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ 8307E7BA20E9F9C700473790 /* Shared */ = {
+ isa = PBXGroup;
+ children = (
+ 83BBE9FC20EB54D800295997 /* imgui_impl_metal.h */,
+ 83BBE9FD20EB54D800295997 /* imgui_impl_metal.mm */,
+ 836D2A2C20EE208D0098E909 /* imgui_impl_osx.h */,
+ 836D2A2D20EE208E0098E909 /* imgui_impl_osx.mm */,
+ 8307E7DC20E9F9C900473790 /* AppDelegate.h */,
+ 8307E7DD20E9F9C900473790 /* AppDelegate.m */,
+ 8307E7BB20E9F9C700473790 /* Renderer.h */,
+ 8307E7BC20E9F9C700473790 /* Renderer.mm */,
+ 8307E7CA20E9F9C900473790 /* ViewController.h */,
+ 8307E7CB20E9F9C900473790 /* ViewController.mm */,
+ 8307E7E620E9F9C900473790 /* main.m */,
+ );
+ path = Shared;
+ sourceTree = "";
+ };
+ 8307E7C520E9F9C900473790 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8307E7C420E9F9C900473790 /* example_apple_metal.app */,
+ 8307E7DA20E9F9C900473790 /* example_apple_metal.app */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 8307E7C620E9F9C900473790 /* iOS */ = {
+ isa = PBXGroup;
+ children = (
+ 836D2A2F20EE4A180098E909 /* Default-568h@2x.png */,
+ 8307E7CD20E9F9C900473790 /* Main.storyboard */,
+ 8307E7D320E9F9C900473790 /* Info-iOS.plist */,
+ 836D2A3120EE4A900098E909 /* Launch Screen.storyboard */,
+ );
+ path = iOS;
+ sourceTree = "";
+ };
+ 8307E7DB20E9F9C900473790 /* macOS */ = {
+ isa = PBXGroup;
+ children = (
+ 8307E7E220E9F9C900473790 /* Main.storyboard */,
+ 8307E7E520E9F9C900473790 /* Info-macOS.plist */,
+ );
+ path = macOS;
+ sourceTree = "";
+ };
+ 83BBE9E320EB46B800295997 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 83BBE9EE20EB471C00295997 /* ModelIO.framework */,
+ 83BBE9EB20EB471700295997 /* Metal.framework */,
+ 83BBE9EA20EB471700295997 /* MetalKit.framework */,
+ 83BBE9E820EB46C100295997 /* ModelIO.framework */,
+ 83BBE9E620EB46BD00295997 /* MetalKit.framework */,
+ 83BBE9E420EB46B900295997 /* Metal.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ 83BBE9F020EB544400295997 /* imgui */ = {
+ isa = PBXGroup;
+ children = (
+ 83BBEA0420EB54E700295997 /* imconfig.h */,
+ 83BBEA0020EB54E700295997 /* imgui.h */,
+ 83BBEA0220EB54E700295997 /* imgui_demo.cpp */,
+ 83BBEA0120EB54E700295997 /* imgui_draw.cpp */,
+ 83BBEA0320EB54E700295997 /* imgui.cpp */,
+ );
+ name = imgui;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8307E7C320E9F9C900473790 /* example_apple_metal_ios */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 8307E7F020E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_ios" */;
+ buildPhases = (
+ 8307E7C020E9F9C900473790 /* Sources */,
+ 8307E7C120E9F9C900473790 /* Frameworks */,
+ 8307E7C220E9F9C900473790 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = example_apple_metal_ios;
+ productName = "imguiex iOS";
+ productReference = 8307E7C420E9F9C900473790 /* example_apple_metal.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 8307E7D920E9F9C900473790 /* example_apple_metal_macos */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 8307E7F320E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_macos" */;
+ buildPhases = (
+ 8307E7D620E9F9C900473790 /* Sources */,
+ 8307E7D720E9F9C900473790 /* Frameworks */,
+ 8307E7D820E9F9C900473790 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = example_apple_metal_macos;
+ productName = "imguiex macOS";
+ productReference = 8307E7DA20E9F9C900473790 /* example_apple_metal.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 8307E7B620E9F9C700473790 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0940;
+ ORGANIZATIONNAME = "Warren Moore";
+ TargetAttributes = {
+ 8307E7C320E9F9C900473790 = {
+ CreatedOnToolsVersion = 9.4.1;
+ };
+ 8307E7D920E9F9C900473790 = {
+ CreatedOnToolsVersion = 9.4.1;
+ };
+ };
+ };
+ buildConfigurationList = 8307E7B920E9F9C700473790 /* Build configuration list for PBXProject "example_apple_metal" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 8307E7B520E9F9C700473790;
+ productRefGroup = 8307E7C520E9F9C900473790 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8307E7C320E9F9C900473790 /* example_apple_metal_ios */,
+ 8307E7D920E9F9C900473790 /* example_apple_metal_macos */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8307E7C220E9F9C900473790 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 836D2A3220EE4A900098E909 /* Launch Screen.storyboard in Resources */,
+ 8307E7CF20E9F9C900473790 /* Main.storyboard in Resources */,
+ 836D2A3020EE4A180098E909 /* Default-568h@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D820E9F9C900473790 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8307E7E420E9F9C900473790 /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8307E7C020E9F9C900473790 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8307E7E820E9F9C900473790 /* Renderer.mm in Sources */,
+ 8307E7CC20E9F9C900473790 /* ViewController.mm in Sources */,
+ 83BBEA0520EB54E700295997 /* imgui_draw.cpp in Sources */,
+ 83BBE9DF20EB40AE00295997 /* AppDelegate.m in Sources */,
+ 83BBEA0920EB54E700295997 /* imgui.cpp in Sources */,
+ 83BBEA0720EB54E700295997 /* imgui_demo.cpp in Sources */,
+ 83BBE9FE20EB54D800295997 /* imgui_impl_metal.mm in Sources */,
+ 83BBE9DE20EB3FFC00295997 /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8307E7D620E9F9C900473790 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 83BBE9E020EB42D000295997 /* ViewController.mm in Sources */,
+ 8307E7E920E9F9C900473790 /* Renderer.mm in Sources */,
+ 83BBEA0620EB54E700295997 /* imgui_draw.cpp in Sources */,
+ 8307E7E720E9F9C900473790 /* main.m in Sources */,
+ 83BBEA0A20EB54E700295997 /* imgui.cpp in Sources */,
+ 83BBEA0820EB54E700295997 /* imgui_demo.cpp in Sources */,
+ 83BBE9FF20EB54D800295997 /* imgui_impl_metal.mm in Sources */,
+ 836D2A2E20EE208E0098E909 /* imgui_impl_osx.mm in Sources */,
+ 8307E7DE20E9F9C900473790 /* AppDelegate.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 8307E7CD20E9F9C900473790 /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8307E7CE20E9F9C900473790 /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+ 8307E7E220E9F9C900473790 /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 8307E7E320E9F9C900473790 /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 8307E7EE20E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ };
+ name = Debug;
+ };
+ 8307E7EF20E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ };
+ name = Release;
+ };
+ 8307E7F120E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/iOS/Info-iOS.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-ios";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 8307E7F220E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/iOS/Info-iOS.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-ios";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 8307E7F420E9F9C900473790 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/macOS/Info-macOS.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.13;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-macos";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 8307E7F520E9F9C900473790 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "$(SRCROOT)/macOS/Info-macOS.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.13;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.imgui.example.apple-metal-macos";
+ PRODUCT_NAME = example_apple_metal;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 8307E7B920E9F9C700473790 /* Build configuration list for PBXProject "example_apple_metal" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7EE20E9F9C900473790 /* Debug */,
+ 8307E7EF20E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 8307E7F020E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_ios" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7F120E9F9C900473790 /* Debug */,
+ 8307E7F220E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 8307E7F320E9F9C900473790 /* Build configuration list for PBXNativeTarget "example_apple_metal_macos" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 8307E7F420E9F9C900473790 /* Debug */,
+ 8307E7F520E9F9C900473790 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 8307E7B620E9F9C700473790 /* Project object */;
+}
diff --git a/examples/example_apple_metal/iOS/Base.lproj/Main.storyboard b/examples/example_apple_metal/iOS/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..24a4009
--- /dev/null
+++ b/examples/example_apple_metal/iOS/Base.lproj/Main.storyboard
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+