Skip to content

Commit

Permalink
Examples: Made the Win32 proc handlers not assert if there is no acti…
Browse files Browse the repository at this point in the history
…ve context yet, to be more flexible with creation order. (#1565)
  • Loading branch information
ocornut committed Jan 21, 2018
1 parent d3e826c commit dd89c9e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/directx10_example/imgui_impl_dx10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ static bool IsAnyMouseButtonDown()
// PS: We treat DBLCLK messages as regular mouse down messages, so this code will work on windows classes that have the CS_DBLCLKS flag set. Our own example app code doesn't set this flag.
IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (ImGui::GetCurrentContext() == NULL)
return 0;

ImGuiIO& io = ImGui::GetIO();
switch (msg)
{
Expand Down
3 changes: 3 additions & 0 deletions examples/directx11_example/imgui_impl_dx11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ static bool IsAnyMouseButtonDown()
// PS: We treat DBLCLK messages as regular mouse down messages, so this code will work on windows classes that have the CS_DBLCLKS flag set. Our own example app code doesn't set this flag.
IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (ImGui::GetCurrentContext() == NULL)
return 0;

ImGuiIO& io = ImGui::GetIO();
switch (msg)
{
Expand Down
3 changes: 3 additions & 0 deletions examples/directx9_example/imgui_impl_dx9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ static bool IsAnyMouseButtonDown()
// PS: We treat DBLCLK messages as regular mouse down messages, so this code will work on windows classes that have the CS_DBLCLKS flag set. Our own example app code doesn't set this flag.
IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (ImGui::GetCurrentContext() == NULL)
return 0;

ImGuiIO& io = ImGui::GetIO();
switch (msg)
{
Expand Down

0 comments on commit dd89c9e

Please sign in to comment.