Navigation Menu

Skip to content

Commit

Permalink
Examples: SDL: changed the signature of ImGui_ImplSDL2_ProcessEvent()…
Browse files Browse the repository at this point in the history
… to use a const SDL_Event*. (#2187)
  • Loading branch information
ocornut committed Nov 23, 2018
1 parent 0c4dee0 commit 35d6483
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Expand Up @@ -37,6 +37,8 @@ Breaking Changes:

Other Changes:

- Examples: SDL: changed the signature of ImGui_ImplSDL2_ProcessEvent() to use a const SDL_Event*. (#2187)


-----------------------------------------------------------------------
VERSION 1.66 (Released 2018-11-22)
Expand Down
4 changes: 3 additions & 1 deletion examples/imgui_impl_sdl.cpp
Expand Up @@ -16,6 +16,7 @@

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-11-14: Changed the signature of ImGui_ImplSDL2_ProcessEvent() to take a 'const SDL_Event*'.
// 2018-08-01: Inputs: Workaround for Emscripten which doesn't seem to handle focus related calls.
// 2018-06-29: Inputs: Added support for the ImGuiMouseCursor_Hand cursor.
// 2018-06-08: Misc: Extracted imgui_impl_sdl.cpp/.h away from the old combined SDL2+OpenGL/Vulkan examples.
Expand Down Expand Up @@ -72,7 +73,8 @@ static void ImGui_ImplSDL2_SetClipboardText(void*, const char* text)
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
bool ImGui_ImplSDL2_ProcessEvent(SDL_Event* event)
// If you have multiple SDL events and some of them are not meant to be used by dear imgui, you may need to filter events based on their windowID field.
bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
{
ImGuiIO& io = ImGui::GetIO();
switch (event->type)
Expand Down
2 changes: 1 addition & 1 deletion examples/imgui_impl_sdl.h
Expand Up @@ -23,4 +23,4 @@ IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* s
IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window);
IMGUI_IMPL_API void ImGui_ImplSDL2_Shutdown();
IMGUI_IMPL_API void ImGui_ImplSDL2_NewFrame(SDL_Window* window);
IMGUI_IMPL_API bool ImGui_ImplSDL2_ProcessEvent(SDL_Event* event);
IMGUI_IMPL_API bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event);

0 comments on commit 35d6483

Please sign in to comment.