mirror of
https://github.com/ocornut/imgui.git
synced 2024-12-18 18:46:13 +01:00
a9cd0f5e42
# Conflicts: # backends/imgui_impl_allegro5.cpp # backends/imgui_impl_allegro5.h # backends/imgui_impl_android.cpp # backends/imgui_impl_android.h # backends/imgui_impl_dx10.cpp # backends/imgui_impl_dx10.h # backends/imgui_impl_dx12.cpp # backends/imgui_impl_dx9.cpp # backends/imgui_impl_dx9.h # backends/imgui_impl_glfw.cpp # backends/imgui_impl_glfw.h # backends/imgui_impl_metal.h # backends/imgui_impl_metal.mm # backends/imgui_impl_opengl2.cpp # backends/imgui_impl_opengl2.h # backends/imgui_impl_opengl3.cpp # backends/imgui_impl_opengl3.h # backends/imgui_impl_sdl2.cpp # backends/imgui_impl_sdl2.h # backends/imgui_impl_sdl3.cpp # backends/imgui_impl_sdl3.h # backends/imgui_impl_vulkan.cpp # backends/imgui_impl_vulkan.h # backends/imgui_impl_win32.cpp # backends/imgui_impl_win32.h # imgui.cpp
58 lines
2.8 KiB
Objective-C
58 lines
2.8 KiB
Objective-C
// dear imgui: Platform Backend for OSX / Cocoa
|
|
// This needs to be used along with a Renderer (e.g. OpenGL2, OpenGL3, Vulkan, Metal..)
|
|
// - Not well tested. If you want a portable application, prefer using the GLFW or SDL platform Backends on Mac.
|
|
// - Requires linking with the GameController framework ("-framework GameController").
|
|
|
|
// Implemented features:
|
|
// [X] Platform: Clipboard support is part of core Dear ImGui (no specific code in this backend).
|
|
// [X] Platform: Mouse support. Can discriminate Mouse/Pen.
|
|
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy kVK_* values are obsolete since 1.87 and not supported since 1.91.5]
|
|
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
|
|
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
|
|
// [X] Platform: IME support.
|
|
// [x] Platform: Multi-viewport / platform windows.
|
|
// Issues:
|
|
// [ ] Platform: Multi-viewport: Window size not correctly reported when enabling io.ConfigViewportsNoDecoration
|
|
// [ ] Platform: Multi-viewport: ParentViewportID not honored, and so io.ConfigViewportsNoDefaultParent has no effect (minor).
|
|
|
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
|
// Learn about Dear ImGui:
|
|
// - FAQ https://dearimgui.com/faq
|
|
// - Getting Started https://dearimgui.com/getting-started
|
|
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
|
|
// - Introduction, links and more at the top of imgui.cpp
|
|
|
|
#include "imgui.h" // IMGUI_IMPL_API
|
|
#ifndef IMGUI_DISABLE
|
|
|
|
#ifdef __OBJC__
|
|
|
|
@class NSEvent;
|
|
@class NSView;
|
|
|
|
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
|
|
IMGUI_IMPL_API bool ImGui_ImplOSX_Init(NSView* _Nonnull view);
|
|
IMGUI_IMPL_API void ImGui_ImplOSX_Shutdown();
|
|
IMGUI_IMPL_API void ImGui_ImplOSX_NewFrame(NSView* _Nullable view);
|
|
|
|
#endif
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// C++ API
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifdef IMGUI_IMPL_METAL_CPP_EXTENSIONS
|
|
// #include <AppKit/AppKit.hpp>
|
|
#ifndef __OBJC__
|
|
|
|
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
|
|
IMGUI_IMPL_API bool ImGui_ImplOSX_Init(void* _Nonnull view);
|
|
IMGUI_IMPL_API void ImGui_ImplOSX_Shutdown();
|
|
IMGUI_IMPL_API void ImGui_ImplOSX_NewFrame(void* _Nullable view);
|
|
|
|
#endif
|
|
#endif
|
|
|
|
#endif // #ifndef IMGUI_DISABLE
|