Polyphase Game Engine
Loading...
Searching...
No Matches
imgui_impl_mac.h
Go to the documentation of this file.
1#pragma once
2
3#if PLATFORM_MAC
4
5// Polyphase's Cocoa platform backend for Dear ImGui. Forked from the vendored
6// backends/imgui_impl_osx.mm and restructured to match imgui_impl_xcb: the
7// engine's NSEvent pump (System_MacCocoa.mm) hands every event to
8// ImGui_ImplMac_EventHandler, mouse coordinates are in backing pixels (what
9// the engine uses for mWindowWidth/Height), and NewFrame takes DisplaySize
10// and DeltaTime from the engine rather than from the view.
11//
12// The header is ObjC-free so it can be included from C++ TUs; the void*
13// parameters are NSView* / NSEvent*.
14
15#include "imgui.h" // IMGUI_IMPL_API
16#ifndef IMGUI_DISABLE
17
18#include <stdint.h>
19
20IMGUI_IMPL_API bool ImGui_ImplMac_Init(void* nsView);
21IMGUI_IMPL_API void ImGui_ImplMac_Shutdown();
22IMGUI_IMPL_API void ImGui_ImplMac_NewFrame();
23
24IMGUI_IMPL_API int32_t ImGui_ImplMac_EventHandler(void* nsEvent);
25
26// Re-assert the NSTextInputClient responder as the window's first responder.
27// Cheap and idempotent; call it after anything that can steal first responder
28// (window becoming key, fullscreen transitions, native modal panels).
29IMGUI_IMPL_API void ImGui_ImplMac_EnsureKeyResponder();
30
31#endif // #ifndef IMGUI_DISABLE
32
33#endif