Skip to content

Commit

Permalink
Merge branch 'master' into docking
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/TODO.txt
  • Loading branch information
ocornut committed Apr 22, 2022
2 parents 505f19e + 5b29d14 commit 8dd5425
Show file tree
Hide file tree
Showing 21 changed files with 145 additions and 164 deletions.
1 change: 1 addition & 0 deletions backends/imgui_impl_allegro5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ bool ImGui_ImplAllegro5_CreateDeviceObjects()
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);

// Create texture
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
int flags = al_get_new_bitmap_flags();
int fmt = al_get_new_bitmap_format();
al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP | ALLEGRO_MIN_LINEAR | ALLEGRO_MAG_LINEAR);
Expand Down
1 change: 1 addition & 0 deletions backends/imgui_impl_dx10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ static void ImGui_ImplDX10_CreateFontsTexture()
io.Fonts->SetTexID((ImTextureID)bd->pFontTextureView);

// Create texture sampler
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
{
D3D10_SAMPLER_DESC desc;
ZeroMemory(&desc, sizeof(desc));
Expand Down
1 change: 1 addition & 0 deletions backends/imgui_impl_dx11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ static void ImGui_ImplDX11_CreateFontsTexture()
io.Fonts->SetTexID((ImTextureID)bd->pFontTextureView);

// Create texture sampler
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
{
D3D11_SAMPLER_DESC desc;
ZeroMemory(&desc, sizeof(desc));
Expand Down
1 change: 1 addition & 0 deletions backends/imgui_impl_dx12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ bool ImGui_ImplDX12_CreateDeviceObjects()
param[1].DescriptorTable.pDescriptorRanges = &descRange;
param[1].ShaderVisibility = D3D12_SHADER_VISIBILITY_PIXEL;

// Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling.
D3D12_STATIC_SAMPLER_DESC staticSampler = {};
staticSampler.Filter = D3D12_FILTER_MIN_MAG_MIP_LINEAR;
staticSampler.AddressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP;
Expand Down
2 changes: 1 addition & 1 deletion backends/imgui_impl_dx9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void ImGui_ImplDX9_SetupRenderState(ImDrawData* draw_data)
vp.MaxZ = 1.0f;
bd->pd3dDevice->SetViewport(&vp);

// Setup render state: fixed-pipeline, alpha-blending, no face culling, no depth testing, shade mode (for gradient)
// Setup render state: fixed-pipeline, alpha-blending, no face culling, no depth testing, shade mode (for gradient), bilinear sampling.
bd->pd3dDevice->SetPixelShader(NULL);
bd->pd3dDevice->SetVertexShader(NULL);
bd->pd3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
Expand Down
1 change: 1 addition & 0 deletions backends/imgui_impl_metal.mm
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ - (void)enqueueReusableBuffer:(MetalBuffer *)buffer
return renderPipelineState;
}

// Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling.
- (id<MTLRenderPipelineState>)_renderPipelineStateForFramebufferDescriptor:(FramebufferDescriptor *)descriptor device:(id<MTLDevice>)device
{
NSError *error = nil;
Expand Down
1 change: 1 addition & 0 deletions backends/imgui_impl_opengl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ bool ImGui_ImplOpenGL2_CreateFontsTexture()
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bit (75% of the memory is wasted, but default font is so small) because it is more likely to be compatible with user's existing shaders. If your ImTextureId represent a higher-level concept than just a GL texture id, consider calling GetTexDataAsAlpha8() instead to save on GPU memory.

// Upload texture to graphics system
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
GLint last_texture;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
glGenTextures(1, &bd->FontTexture);
Expand Down
1 change: 1 addition & 0 deletions backends/imgui_impl_opengl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ bool ImGui_ImplOpenGL3_CreateFontsTexture()
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bit (75% of the memory is wasted, but default font is so small) because it is more likely to be compatible with user's existing shaders. If your ImTextureId represent a higher-level concept than just a GL texture id, consider calling GetTexDataAsAlpha8() instead to save on GPU memory.

// Upload texture to graphics system
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
GLint last_texture;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
glGenTextures(1, &bd->FontTexture);
Expand Down
2 changes: 1 addition & 1 deletion backends/imgui_impl_opengl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
#endif
#if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__))
#define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es"
#elif defined(__EMSCRIPTEN__)
#elif defined(__EMSCRIPTEN__) || defined(__amigaos4__)
#define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100"
#else
// Otherwise imgui_impl_opengl3_loader.h will be used.
Expand Down
2 changes: 1 addition & 1 deletion backends/imgui_impl_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#include <TargetConditionals.h>
#endif

#if SDL_VERSION_ATLEAST(2,0,4) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__) && !(defined(__APPLE__) && TARGET_OS_IOS)
#if SDL_VERSION_ATLEAST(2,0,4) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__) && !(defined(__APPLE__) && TARGET_OS_IOS) && !defined(__amigaos4__)
#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE 1
#else
#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE 0
Expand Down
2 changes: 2 additions & 0 deletions backends/imgui_impl_sdlrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ bool ImGui_ImplSDLRenderer_CreateFontsTexture()
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bit (75% of the memory is wasted, but default font is so small) because it is more likely to be compatible with user's existing shaders. If your ImTextureId represent a higher-level concept than just a GL texture id, consider calling GetTexDataAsAlpha8() instead to save on GPU memory.

// Upload texture to graphics system
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
bd->FontTexture = SDL_CreateTexture(bd->SDLRenderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, width, height);
if (bd->FontTexture == NULL)
{
Expand All @@ -219,6 +220,7 @@ bool ImGui_ImplSDLRenderer_CreateFontsTexture()
}
SDL_UpdateTexture(bd->FontTexture, NULL, pixels, 4 * width);
SDL_SetTextureBlendMode(bd->FontTexture, SDL_BLENDMODE_BLEND);
SDL_SetTextureScaleMode(bd->FontTexture, SDL_ScaleModeLinear);

// Store our identifier
io.Fonts->SetTexID((ImTextureID)(intptr_t)bd->FontTexture);
Expand Down
1 change: 1 addition & 0 deletions backends/imgui_impl_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ static void ImGui_ImplVulkan_CreateFontSampler(VkDevice device, const VkAllocati
if (bd->FontSampler)
return;

// Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling.
VkSamplerCreateInfo info = {};
info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
info.magFilter = VK_FILTER_LINEAR;
Expand Down
1 change: 1 addition & 0 deletions backends/imgui_impl_wgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ static void ImGui_ImplWGPU_CreateFontsTexture()
}

// Create the associated sampler
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
{
WGPUSamplerDescriptor sampler_desc = {};
sampler_desc.minFilter = WGPUFilterMode_Linear;
Expand Down
9 changes: 9 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,15 @@ Other Changes:
or interacting with a game/3D view).
- Clipper: Fixed a regression in 1.86 when not calling clipper.End() and late destructing the
clipper instance. High-level languages (Lua,Rust etc.) would typically be affected. (#4822)
- Layout: Fixed mixing up SameLine() and SetCursorPos() together from creating situations where line
height would be emitted from the wrong location (e.g. 'ItemA+SameLine()+SetCursorPos()+ItemB' would
emit ItemA worth of height from the position of ItemB, which is not necessarily aligned with ItemA).
- Sliders, Drags: Fixed dragging when using hexadecimal display format string. (#5165, #3133)
- Sliders, Drags: Fixed manual input when using hexadecimal display format string. (#5165, #3133)
- InputScalar: Fixed manual input when using %03d style width in display format string. (#5165, #3133)
- InputScalar: Automatically allow hexadecimal input when format is %X (without extra flag).
- InputScalar: Automatically allow scientific input when format is float/double (without extra flag).
- Nav: Fixed nav movement in a scope with only one disabled item from focusing the disabled item. (#5189)
- IsItemHovered(): added ImGuiHoveredFlags_NoNavOverride to disable the behavior where the
return value is overriden by focus when gamepad/keyboard navigation is active.
- InputText: Fixed pressing Tab emitting two tabs characters because of dual Keys/Chars events being
Expand All @@ -142,7 +146,10 @@ Other Changes:
- Stack Tool: Added option to copy item path to clipboard. (#4631)
- Drawlist: Fixed PathArcTo() emitting terminating vertices too close to arc vertices. (#4993) [@thedmd]
- DrawList: Fixed texture-based anti-aliasing path with RGBA textures (#5132, #3245) [@cfillion]
- Misc: Fixed calling GetID("label") _before_ a widget emitting this item inside a group (such as InputInt())
from causing an assertion when closing the group. (#5181).
- Misc: Fixed IsAnyItemHovered() returning false when using navigation.
- Misc: Allow redefining IM_COL32_XXX layout macros to facilitate use on big-endian systems. (#5190, #767, #844)
- Misc: Added IMGUI_STB_SPRINTF_FILENAME to support custom path to stb_sprintf. (#5068, #2954) [@jakubtomsu]
- Misc: Added constexpr to ImVec2/ImVec4 inline constructors. (#4995) [@Myriachan]
- Misc: Updated stb_truetype.h from 1.20 to 1.26 (many fixes). (#5075)
Expand All @@ -154,6 +161,7 @@ Other Changes:
reported incorrectly on Linux/X11, due to a bug in GLFW. [@rokups]
- Backends: SDL: Fixed dragging out viewport broken on some SDL setups. (#5012) [@rokups]
- Backends: SDL: Added support for extra mouse buttons (SDL_BUTTON_X1/SDL_BUTTON_X2). (#5125) [@sgiurgiu]
- Backends: SDL, OpenGL3: Fixes to facilitate building on AmigaOS4. (#5190) [@afxgroup]
- Backends: OSX: Monitor NSKeyUp events to catch missing keyUp for key when user press Cmd + key (#5128) [@thedmd]
- Examples: Emscripten: Fix building for latest Emscripten specs. (#3632)

Expand All @@ -180,6 +188,7 @@ Breaking Changes:
- Added io.AddMousePosEvent(), io.AddMouseButtonEvent(), io.AddMouseWheelEvent() functions,
obsoleting writing directly to io.MousePos, io.MouseDown[], io.MouseWheel, etc.
- This enable input queue trickling to support low framerates. (#2787, #1992, #3383, #2525, #1320)
- For all calls to IO new functions, the Dear ImGui context should be bound/current.
- Reworked IO keyboard input API: (#4921, #2625, #3724) [@thedmd, @ocornut]
- Added io.AddKeyEvent() function, obsoleting writing directly to io.KeyMap[], io.KeysDown[] arrays.
- For keyboard modifiers, you can call io.AddKeyEvent() with ImGuiKey_ModXXX values,
Expand Down
Loading

0 comments on commit 8dd5425

Please sign in to comment.