1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-13 18:50:58 +01:00
Commit Graph

224 Commits

Author SHA1 Message Date
Sergiu Giurgiu
31e77eacdb Backends: SDL: Add extra mouse buttons handling (#5125) 2022-03-22 16:59:46 +01:00
ocornut
fd06ed833b Misc: tweaks + fix warnings on backends withtout -wno-memaccess (#4995, #5104) 2022-03-13 17:57:32 +07:00
Rokas Kupstys
6315716f23 Backends: Glut: Fix comparison operator precedence. 2022-03-01 15:20:40 +01:00
ocornut
1e18da5c38 Backends, Examples: Add comments about using WndProc handler and WantCaptureXXX flags. (#5061)
+ update README.
2022-02-28 20:51:50 +01:00
Jan Sikorski
a61ca097a7
Backends: OSX: Fix typo in scrolling event handler. (#5036) 2022-02-19 18:57:41 +01:00
ocornut
e52bb147a7 Backends: GLFW: Added ImGui_ImplGlfw_InstallCallbacks()/ImGui_ImplGlfw_RestoreCallbacks(). (#4981) 2022-02-07 16:11:05 +01:00
ocornut
732bc2058e Backends: GLFW: Handle spurious leave/enter sequences apparently submitted by X11/GLFW combo. (#4984) 2022-02-07 15:59:49 +01:00
Rokas Kupstys
40fd163a3b Backends: OpenGL3: Fix OpenGL ES2 includes on Apple systems.
# Conflicts:
#	backends/imgui_impl_opengl3.cpp
#	docs/CHANGELOG.txt
2022-02-07 12:26:19 +01:00
ocornut
2554b512c0 Backends: OSX: Forward keyDown/keyUp events to OS when unused by Dear ImGui. 2022-02-07 11:55:24 +01:00
Clownacy
c6cab1f352 Backends: SDL: Added SDL_Renderer* parameter to ImGui_ImplSDL2_InitForSDLRenderer(). Use SDL_GetRendererOutputSize() instead of SDL_GL_GetDrawableSize() when bound to a SDL_Renderer. (#4927)
This is (kind of) an OpenGL-only function, which should be avoided when SDL2 isn't using OpenGL.
The only alternative that is recommended is SDL_GetRendererOutputSize, which limits this fix to the SDL_Renderer backend. Still, I think it's better than nothing.
I say that SDL_GL_GetDrawableSize is "kind of" OpenGL-only because it does technically work even when SDL2 isn't using OpenGL.
It's just that it becomes a shim to SDL_GetWindowSize, which is not suitable for high-DPI usage because it reflects the size of the window in screen coordinates, not actual pixels, so it really should be avoided when not using OpenGL.
2022-02-04 16:51:29 +01:00
Clownacy
c39192ba64 Backends: SDL_Renderer: Fix texture atlas format on big-endian hardware (#4927)
SDL_PIXELFORMAT_RGBA32 is intended for byte arrays where the channels
are specifically in the RGBA order. However, this is not what
GetTexDataAsRGBA32 does: rather, it constructs an array where each
pixel is an unsigned int in ABGR order. On little-endian platforms,
this does indeed result in an RGBA byte order, however, on big-endian
platforms, this results in an ABGR byte order, which does not match
the PIXELFORMAT enum.

What should be used is the SDL_PIXELFORMAT_ABGR8888 enum, which
specifies that the pixels are in native-endian ABGR, which they are.
2022-02-04 16:43:05 +01:00
ocornut
43177324c0 Backends: GLFW: Fixed miss untranslation of keypad keys. (#4921, #452) 2022-02-01 15:29:10 +01:00
rokups
551ab84c2d Backends: OSX: Fix building with old Xcode versions.
Builds have failed on Xcode versions that do not yet support `@available` or do not have new APIs (that are unavailable on target OS version) defined at all. Using true build time version checks fixes these issues.
2022-01-31 14:41:56 +01:00
thedmd
5429f0f6b5 Backends: OSX, Android: Replaced AddKeyModsEvent() added by 790132a in favor of unified key enum system. (#4921, #4858) 2022-01-27 17:46:48 +01:00
ocornut
c906c65cac (BREAKING) Replaced AddKeyModsEvent() added by 790132a in favor of unified key enum system. Backends: update most. (#4921, #4858)
Sorry this is an unusual breaking but since we are WIP it is a good time to make a correction.
2022-01-27 17:46:48 +01:00
ocornut
4caf1e9b59 Backends: GLFW: fix ImGui_ImplGlfw_TranslateUntranslatedKey() for grave accents. (#456, #2625) + fix preceeding commit.
Amend 100ede57 + amend b17b2fb
2022-01-24 13:49:57 +01:00
ocornut
cda3db1449 Backends: SDL: Fixed key mapping for ImGuiKey_Menu (#4921) + misc typos (#4928) 2022-01-24 12:19:51 +01:00
ocornut
62d6be3747 IO: Removed ImGuiInputSource from public api for now, unnecessary. (#4858, #787) 2022-01-20 17:39:25 +01:00
thedmd
5ea47d9560 Backends: OSX: Add full gamepad support using io.AddKeyEvent(), io.AddKeyAnalogEvent(), stopped writing to io.NavInputs[]. (#4858, #787) 2022-01-20 17:25:49 +01:00
ocornut
39c3412f91 Backends: SDL: Add full gamepad support using io.AddKeyEvent(), io.AddKeyAnalogEvent(), stopped writing to io.NavInputs[]. (#4858, #787) 2022-01-20 17:25:31 +01:00
ocornut
3d85433748 Backends: GLFW: Add full gamepad support using io.AddKeyEvent(), io.AddKeyAnalogEvent(), stopped writing to io.NavInputs[]. (#4858, #787) 2022-01-20 17:25:15 +01:00
ocornut
9f8c599ca7 Backends: Win32: Add full gamepad support using io.AddKeyEvent(), io.AddKeyAnalogEvent(), stopped writing to io.NavInputs[]. (#4858, #787) 2022-01-20 17:25:04 +01:00
ocornut
6e63fcaca3 Backends: Vulkan: Amends, fix miscast on 32-bit systems with the right ImTextureID=ImU64. (#914) 2022-01-20 16:56:29 +01:00
ocornut
ceb26bac48 Backends: Vulkan: Added support for ImTextureID as VkDescriptorSet, amends. (#914) 2022-01-20 15:53:28 +01:00
Marcell Kiss
29f104319e Backends: Vulkan: Added support for ImTextureID as VkDescriptorSet, add ImGui_ImplVulkan_AddTexture(). (#914) 2022-01-20 15:53:11 +01:00
thedmd
b8e56dce83 IO: Added AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent() api + updated all Backends. (#4858) (input queue code will be next commit)
Details: note that SDL, OSX and GLFW backends removed recording of MouseJustPressed[] which will be unnecessary with input queue (which is the NEXT commit). (#2787, #1992, #3383, #2525, #1320)
2022-01-17 17:35:37 +01:00
ocornut
b6582a471a Backends: OSX: Fix Game Controller nav mapping to use shoulder for both focusing and tweak speed. (#4759) 2022-01-17 16:22:32 +01:00
ocornut
92c4ff1c2f Rename ImGuiKey_LeftControl to ImGuiKey_LeftCtrl, ImGuiKey_RightControl to ImGuiKey_RightCtrl + made key order match mods order. (#4858) 2022-01-17 15:42:04 +01:00
ocornut
0755767440 Backends: move io.AddKeyModsEvent() next to io.AddKeyEvent() submission, rely on mods from platform/source. (#4858) + fix #2622 again broken by 746c9f7
Amended to submit modifiers before.
2022-01-17 15:21:17 +01:00
RandomErrorMessage
45c4365ec3 Backends: GLFW: glfwGetKeyName is not implemented in emscripten (#4907, #4858) 2022-01-14 11:54:35 +01:00
ocornut
6188e94108 Examples: Vulkan: fill Subpass and MSAASamples to increase discoverability (#4886) + IO docs update (#4858)
https://github.com/mosra/magnum-integration/pull/89
2022-01-14 11:51:59 +01:00
ocornut
553b04883e Backends: SDL: Fix for Emscriptem. Amend 98ce013. 2022-01-13 18:52:19 +01:00
ocornut
200a8f1ea2 Backends: GLFW: Update mouse inputs using glfwSetCursorPosCallback() (breaking) + fallback to provide it when focused but not hovered/captured + update MousePos before MouseButtons.
+ Allegro5 remove unnecessary clear.
2022-01-12 17:48:47 +01:00
ocornut
98ce013242 Backends: SDL: Update mouse inputs using SDL_MOUSEMOTION/SDL_WINDOWEVENT_LEAVE + fallback to provide it when focused but not hovered/captured + update MousePos before MouseButtons. 2022-01-12 17:48:47 +01:00
ocornut
bf4de2a46b Backends: Win32: Update mouse inputs using WM_MOUSEMOVE/WM_MOUSELEAVE + fallback to provide it when focused but not hovered/captured + update MousePos before Key Modifiers. 2022-01-12 17:48:46 +01:00
ocornut
7f8a89c25c Backends: Win32, SDL: maintain MouseButtonsDown instead of using IsAnyMouseDown(). Internals: added GetInputSourceName(). 2022-01-12 16:12:10 +01:00
Liu Liu
457d4b7b72 Backends: OSX: Adedd basic IME support for macOS. (#3108, #2598) 2022-01-12 14:37:05 +01:00
Théo Monnom
0818a42396 Backend: WebGPU: Fixed incorrect size parameters in WGPU backend (#4891)
+ squash SDL alignment bits.
2022-01-12 14:16:55 +01:00
ocornut
956e03009a Backends: OSX: Build fIx. Made GetKeyName() input tolerant. Internals: added GetNavInputName(). 2022-01-11 18:48:16 +01:00
ocornut
e8172fdfbc Rename io.AddKeyModEvent() -> io.AddKeyModsEvent() and updated backends accordingly. (#2625, #4858)
Amend 790132a (breaking)
2022-01-10 17:00:32 +01:00
ocornut
b2e2cc44c2 Backends: OSX: Fixed typo. 2022-01-10 15:47:37 +01:00
ocornut
790132a672 Added io.AddKeyModEvent() and updated backends accordingly. (#2625, #4858) 2022-01-10 15:17:00 +01:00
thedmd
1797135db5 Backends: Android: Update to use io.AddEventKey() will full key map (#2625, #4858) 2022-01-10 15:15:24 +01:00
thedmd
ee436aa803 Backends: OSX: Update to use io.AddEventKey() will full key map (#2625, #1873, #4858) 2022-01-10 15:14:52 +01:00
thedmd
da1864d79e Backends: GLUT: Update to use io.AddEventKey() will full key map (#2625, #4858) 2022-01-10 15:14:01 +01:00
thedmd
1bfe4a75be Backends: Allegro5: Update to use io.AddEventKey() will full key map (#2625, #4858) 2022-01-10 15:13:36 +01:00
thedmd
fe646ea591 Backends: SDL2: Update to use io.AddEventKey() will full key map (#2625, #4858) + created localized key (using keycode instead of scancode) (#456)
Legacy indexing stills uses Scancode
2022-01-10 15:12:58 +01:00
thedmd
ecd212c01d Backends: GLFW: Update to use io.AddEventKey() will full key map (#2625, #4858) 2022-01-10 15:12:23 +01:00
thedmd
746c9f76e4 Backends: Win32: Update to use io.AddEventKey() will full key map (#2625, #4858) 2022-01-10 15:11:54 +01:00
ocornut
afffcd5810 Inputs: rename ImGuiKey_KeyPadEnter > ImGuiKey_KeypadEnter (#2625) 2022-01-06 14:25:56 +01:00
ocornut
100ede5764 Backends: GLFW: Fix CTRL+A, CTRL+Y, CTRL+Z to match keyboard layout. Converting GLFW untranslated keycodes back to translated keycodes. (#456, #2625) 2022-01-05 16:57:50 +01:00
ocornut
3a90dc3893 Platform IME: changed io.ImeSetInputScreenPosFn() to io.SetPlatformImeDataFn() API.
Ref #2589, #2598, #3108, #3113, #3653, #4642
2022-01-05 13:47:20 +01:00
ocornut
efa50f72a7 Backends: Metal: Ignore ImDrawCmd where ElemCount == 0. (#4857) 2022-01-03 22:14:19 +01:00
luigifcruz
41e39ea6e1 Backends: Metal: Add Metal C++ bindings support. (#4824, #4746) 2021-12-30 15:04:03 +01:00
ocornut
dbeea7220f Backends: Silence overzealous warnings. (#4834) Add comments about SetDragDropPayload() return value. (#4835) 2021-12-29 12:44:12 +01:00
ocornut
89a28209e8 Version 1.87 WIP + Backends: OpenGL3: Fixed a buffer overflow in imgui_impl_opengl3_loader.h init, added in 1.86 (#4468, #4830) 2021-12-26 20:02:02 +01:00
Sean Ridenour
4bad852a78 Backends: SDL_Renderer: Handle change to SDL_RenderGeometryRaw() function signature in SDL 2.0.19 (#4819) 2021-12-21 14:32:41 +01:00
ocornut
d9bc1e44af Backends: Marmalade: Removed obsolete Marmalade backend (imgui_impl_marmalade.cpp) + example. (#368, #375) 2021-12-20 19:29:41 +01:00
thedmd
0cdc4a9565 Backends: Win32: Store left/right variants of Ctrl/Shift/Alt mods in KeysDown[] array. (#2625)
Technically not much required yet but will be by extra-keys work. fix miscleared GLFW field for consistency (no effect)
2021-12-16 18:16:35 +01:00
ocornut
389982eb5a Backends: OpenGL3: Using buffer orphaning + glBufferSubData(), seems to fix leaks with multi-viewports with some Intel HD drivers.. (#4468, #4504, #2981, #3381) 2021-12-15 11:50:00 +01:00
Stuart Carnie
1b6b8602c1 Backends: OSX: Fix keyboard support. Handle scroll cancel. Don't set mouse cursor shape unconditionally. (#4759, #4253, #1873)
Note the original FIXME: refered to GLFWs Cocoa implementation, which is largely what this commit provides.
2021-12-13 11:56:43 +01:00
Stuart Carnie
b720f1f03c Backends: OSX: Add Game Controller support. (#4759) 2021-12-13 11:25:59 +01:00
ocornut
a19815dc6b Backends: Allegro5: Fixed mishandling of the ImDrawCmd::IdxOffset field. (#4790) 2021-12-08 16:34:57 +01:00
ocornut
c80e8b964c Backends: OpenGL2, Marmalade: Fixed mishandling of the ImDrawCmd::IdxOffset field. (#4790) 2021-12-08 16:26:52 +01:00
Rokas Kupstys
5c388c39f4 Backends: SDL_Renderer: Added support for large meshes (64k+ vertices) with 16-bit indices, enable 'ImGuiBackendFlags_RendererHasVtxOffset' in this backend. (#3926) 2021-12-03 12:28:03 +01:00
ocornut
440824d431 Backends: Fixed early out on empty clip rect. In particular, DX12 backend would warn about it (others not so much). (#4775, #4464)
Amend/fix 2b0bd40b
2021-11-30 21:48:29 +01:00
ocornut
5ccb66794b Backends: WebGPU: Passing explicit buffer sizes as validation layers appears to not do what the in-flux specs says. (#4766 2021-11-29 12:18:25 +01:00
ocornut
19c3773cc0 Backends: Vulkan: Call vkCmdSetScissor() with a full-viewport at end of render. (#4644) 2021-10-15 12:11:11 +02:00
ocornut
bbd5119a26 Backends: Vulkan: comments about user using VK_DYNAMIC_STATE_VIEWPORT / VK_DYNAMIC_STATE_SCISSOR and not calling vkCmdSetViewport() / vkCmdSetScissor(). (#4644) 2021-10-15 12:01:35 +02:00
ocornut
dde31030e9 Backends: SDL_Renderer: use SDL_RenderIsClipEnabled() to pass NULL to SDL_RenderSetClipRect (#3926, #4582, #4633) 2021-10-07 15:07:58 +02:00
Basil Fierz
30a6873a44
Backends: WebGPU: Fix missing initialization of local variable (#4634) 2021-10-07 14:58:09 +02:00
Basil Fierz
25332fa5ac Backends: Emscripten: Update the webgpu API to be compatible with chrome 4633 (#4512) 2021-10-06 17:51:00 +02:00
ocornut
e443ea139d Backends: SDL_Renderer: Backup and restore modified ClipRect/Viewport. (#3926, #4582) 2021-10-06 13:41:39 +02:00
ocornut
677fe33990 Backends: DX12: use dxgiformat.h to fix using forward declared DXGI_FORMAT (#4594) 2021-09-30 11:53:20 +02:00
ocornut
fba756176d Backends: SDL_Renderer: Amend 1d2d246, various tweaks, fixes, sync to latest. (#3926) 2021-09-21 19:29:48 +02:00
Sylvain
62b17f928e Backends: SDL_Renderer: Added renderer backend for SDL 2.0.17+ (#3926)
(Squashed 20 commits)
2021-09-21 19:29:48 +02:00
James McCartney
bc3d267c51 Backends: OSX: Use mach_absolute_time as CFAbsoluteTimeGetCurrent can jump backwards. (#4557, #4563) 2021-09-21 12:36:37 +02:00
ocornut
c6ca327fb2 Backends: Added more implicit asserts to detect invalid/redundant calls to Shutdown functions. (#4562) 2021-09-20 18:43:05 +02:00
ocornut
755bf985d2 Backends: OpenGL3: Made our custom GL loader a bit more tolerant of use of another loader in same compilation unit. (#4445, #4514) 2021-09-07 14:48:26 +02:00
Jackamilio
03ce17f0a5 Backends: Allegro: Fixed clipping rectangles (#4498) broken by 2b0bd40b (#4464) 2021-08-31 12:52:54 +02:00
Cort
80ed4eba87
Backends: Vulkan: non-dispatchable handles should compare to VK_NULL_HANDLE, not NULL (#4475) 2021-08-24 21:53:54 +02:00
Rokas Kupstys
2b0bd40b99 Backends: Metal: Fixed a crash when clipping rect larger than framebuffer is submitted. (#4464)
Backends: Normalize clipping rect handling across backends.
+ Squashed amends.
2021-08-24 18:23:13 +02:00
Siarhei Fiedartsou
f8bad7e1e3 Backends: OpenGL3: Add TargetConditionals.h (#4473) + standardize include 2021-08-24 15:36:44 +02:00
Corentin Wallez
e652527313 Backends: WebGPU: Update impl_wgpu for an emscripten change 2021-08-24 14:55:43 +02:00
Rokas Kupstys
4c22b3e5d9 Backends: OpenGL3: Fix gl3wProcs colliding with gl3w. (#4445) 2021-08-24 14:33:04 +02:00
Nicolas Noble
e3e1fbcf02 Backends: OpenGL3: OpenGL: Fixed ES 3.0 shader ("#version 300 es") to use normal precision floats. (#4463) 2021-08-23 15:03:27 +02:00
ocornut
d2ffbd9b86 Version 1.84
Fix PVS Studio false positive //-V1020
Fix missing #ifndef for IMGUI_IMPL_OPENGL_LOADER_CUSTOM path
2021-08-20 18:03:55 +02:00
Rokas Kupstys
fc062e6028 Backends: OpenGL3: Update loader to include APIs used by test framework. 2021-08-20 17:22:27 +02:00
ocornut
e3988a84db Backends: OpenGL3: Embed our own minimal GL loader (amends). (#4445) 2021-08-19 16:24:59 +02:00
Rokas Kupstys
459de65477 Backends: OpenGL3: Embed our own minimal GL loader based on gl3w and use it in SDL/GLFW examples. (#4445)
Loader repository at https://github.com/dearimgui/gl3w_stripped
Removed support for using custom loaders in examples/opengl3 backend
2021-08-19 16:24:58 +02:00
ocornut
f24abbc47d Fix various warnings (#4442) 2021-08-18 12:38:24 +02:00
thedmd
2f40be638f IO, Backends: add io.AddFocusEvent(). Clear pressed keys after loosing input focus (#3532)
Amend/fix #2445, #2696, #3751, #4377
2021-08-17 20:10:45 +02:00
ocornut
b380d3abe3 Backends: OpenGL3: Clarify use of GL_POLYGON_MODE. 2021-08-17 15:16:29 +02:00
ocornut
f99fe72c42 Backends: Win32: Fixed keyboard modifiers being reported when host window doesn't have focus. (#2622) 2021-08-02 17:22:33 +02:00
ocornut
2ad912bb85 Backends: Win32, SDL, GLFW: only honor io.WantSetMousePos when focused + fix GLFW uninstalling handler + tweaks to reduce branch drift with docking. (#787, #2445, #2696, #3751, #4377) 2021-08-02 16:19:50 +02:00
ocornut
db686ad522 Backends: Win32: Mouse position is correctly reported when the host platform window is hovered but not focused. (#2445, #2696, #3751, #4377) 2021-07-29 19:38:33 +02:00
ocornut
044fd0cd2d Backends: GLFW: Mouse position is correctly reported when the host platform window is hovered but not focused. (#3751, #4377, #2445) 2021-07-29 19:37:18 +02:00
ocornut
1cdd110eb4 Backends: SDL2: Mouse position is correctly reported when the host platform window is hovered but not focused. (#2445, #3751, #4377)
(requires SDL 2.0.5 because SDL_GetMouseFocus() is only usable with SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH).
2021-07-29 18:47:43 +02:00
ocornut
baa4caf9e3 Backends: GLFW: Installing and exposed ImGui_ImplGlfw_MonitorCallback() for forward compatibility with docking branch.
+ Comments (#3934)
2021-07-07 14:12:48 +02:00
ocornut
327a5d8253 Fix warning + apply trailing whitespaces in stb_ libs (as applied on nothings/stb on 2020/02/02, facilitating further diffs) 2021-07-05 17:52:44 +02:00