mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-07 15:05:47 +01:00
add imgui include and use IMGUI_IMPL_API and honour IMGUI_DISABLE
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
8e35b501a4
commit
bf1893272a
@ -32,19 +32,24 @@
|
||||
// Don't forget to set io.BackendFlags |= ImGuiBackendFlags_HasGamepad when a gamepad is connected.
|
||||
|
||||
#pragma once
|
||||
#include "imgui.h"
|
||||
|
||||
#ifndef IMGUI_DISABLE
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#error The imgui_impl_emscripten backend requires Emscripten.
|
||||
#error The imgui_impl_emscripten backend reqiuires Emscripten.
|
||||
#endif
|
||||
|
||||
// Initialise the Emscripten backend, setting input callbacks. This should be called after ImGui::CreateContext();
|
||||
void ImGui_ImplEmscripten_Init();
|
||||
IMGUI_IMPL_API void ImGui_ImplEmscripten_Init();
|
||||
|
||||
// Shut down the Emscripten backend. This unsets all Emscripten input callbacks set by Init.
|
||||
// Note it'll also unset any Emscripten input callbacks set elsewhere in the program!
|
||||
// Note also there is no obligation to ever call this, as there is not necessarily any such concept as "shutting down" when running in the browser, and we have no resources to release. The user can just close the tab.
|
||||
void ImGui_ImplEmscripten_Shutdown();
|
||||
IMGUI_IMPL_API void ImGui_ImplEmscripten_Shutdown();
|
||||
|
||||
// Call every frame to synchronize Dear ImGui's cursor state with the browser's native cursors.
|
||||
// If you are not using browser native cursor rendering (i.e. if Dear ImGui is rendering cursors internally), you don't need to call this.
|
||||
void ImGui_ImplEmscripten_NewFrame();
|
||||
// Call every frame to update polled input events, i.e. gamepads, and update imgui's cursors.
|
||||
// If you aren't using gamepad input to control imgui, and you're not using browser native cursor rendering (i.e. if imgui is rendering cursors internally), you don't need to call this.
|
||||
IMGUI_IMPL_API void ImGui_ImplEmscripten_NewFrame();
|
||||
|
||||
#endif // IMGUI_DISABLE
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user