Skip to content

Commit 1616408

Browse files
committed
Sync With IMGUI v1.91.0
1 parent 20af84a commit 1616408

File tree

11 files changed

+432
-180
lines changed

11 files changed

+432
-180
lines changed

impl/PasImGui.Backend.SDL2.pas

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@
417417

418418
// Done
419419
// Note: native IME will only display if user calls SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1") _before_ SDL_CreateWindow().
420-
Procedure ImGui_ImplSDL2_SetPlatformImeData(viewport: PImGuiViewport; Data: PImGuiPlatformImeData); Cdecl;
420+
Procedure ImGui_ImplSDL2_SetPlatformImeData(ctx: PImGuiContext; viewport: PImGuiViewport; data: PImGuiPlatformImeData); Cdecl;
421421
Var
422422
r: TSDL_Rect;
423423
Begin
@@ -617,7 +617,7 @@
617617
io^.SetClipboardTextFn := @ImGui_ImplSDL2_SetClipboardText;
618618
io^.GetClipboardTextFn := @ImGui_ImplSDL2_GetClipboardText;
619619
io^.ClipboardUserData := nil;
620-
io^.SetPlatformImeDataFn := @ImGui_ImplSDL2_SetPlatformImeData;
620+
io^.PlatformSetImeDataFn := @ImGui_ImplSDL2_SetPlatformImeData;
621621

622622
// Load mouse cursors
623623
bd^.MouseCursors[ImGuiMouseCursor_Arrow] := SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
@@ -900,8 +900,7 @@
900900
io^.DisplaySize := ImVec2.New(Single(w), Single(h));
901901

902902
If (w > 0) And (h > 0) Then
903-
io^.DisplayFramebufferScale :=
904-
ImVec2.New(Single(display_w) / w, Single(display_h) / h);
903+
io^.DisplayFramebufferScale := ImVec2.New(Single(display_w) / w, Single(display_h) / h);
905904

906905
// Update monitors
907906
If bd^.WantUpdateMonitors Then

impl/PasImGui.Renderer.OpenGL3.pas

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
ElementsHandle: GLuint;
9090
VertexBufferSize: GLsizeiptr;
9191
IndexBufferSize: GLsizeiptr;
92+
HasPolygonMode : Boolean;
9293
HasClipOrigin: Boolean;
9394
UseBufferSubData: Boolean;
9495
End;
@@ -612,8 +613,7 @@ function ImGui_OpenGL3_Init(glsl_version: PAnsiChar): Boolean;
612613
If (bd^.GlVersion >= 320) Then
613614
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, @bd^.GlProfileMask);
614615

615-
bd^.GlProfileIsCompat := (bd^.GlProfileMask And
616-
GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) <> 0;
616+
bd^.GlProfileIsCompat := (bd^.GlProfileMask And GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) <> 0;
617617

618618
{$IfDef IMGUI_OPENGL_ES3}
619619
bd^.GlProfileIsES3 := true;
@@ -946,15 +946,13 @@ function ImGui_ImplOpenGL3_CreateDeviceObjects : Boolean;
946946
end;
947947

948948
// Create shaders
949-
vertex_shader_with_version[0] := @bd^.GlslVersionString[0];
950-
vertex_shader_with_version[1] := vertex_shader;
949+
vertex_shader_with_version := [@bd^.GlslVersionString[0], vertex_shader];
951950
vert_handle := glCreateShader(GL_VERTEX_SHADER);
952951
glShaderSource(vert_handle, 2, @vertex_shader_with_version, nil);
953952
glCompileShader(vert_handle);
954953
CheckShader(vert_handle, 'vertex shader');
955954

956-
fragment_shader_with_version[0] := @bd^.GlslVersionString[0];
957-
fragment_shader_with_version[1] := fragment_shader;
955+
fragment_shader_with_version := [@bd^.GlslVersionString[0], fragment_shader];
958956
frag_handle := glCreateShader(GL_FRAGMENT_SHADER);
959957
glShaderSource(frag_handle, 2, @fragment_shader_with_version, nil);
960958
glCompileShader(frag_handle);
@@ -999,10 +997,12 @@ procedure ImGui_OpenGL3_NewFrame;
999997
bd: PImGui_ImplOpenGL3_Data;
1000998
Begin
1001999
bd := ImGui_ImplOpenGL3_GetBackendData();
1002-
Assert(bd <> nil, 'Did you call ImGui_ImplOpenGL3_Init()?');
1000+
Assert(bd <> nil, 'Context or backend not initialized! Did you call ImGui_OpenGL3_Init()?');
10031001

10041002
if (bd^.ShaderHandle = 0) then
10051003
ImGui_ImplOpenGL3_CreateDeviceObjects();
1004+
if (bd^.FontTexture = 0)then
1005+
ImGui_ImplOpenGL3_CreateFontsTexture();
10061006
End;
10071007

10081008
procedure ImGui_ImplOpenGL3_ShutdownPlatformInterface();

libs/static/linux64/libcimgui.a

-92.1 KB
Binary file not shown.

libs/static/win64/libcimgui.a

89.3 KB
Binary file not shown.

libs/static/win64/libmsvcr120.a

-1.54 MB
Binary file not shown.

libs/static/win64/libmsvcrt.a

2.06 KB
Binary file not shown.
-2.13 KB
Binary file not shown.

libs/static/win64/libstdc++.a

-7.19 MB
Binary file not shown.

src/ImGuiApis.Impl.inc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

2+
{ImFontGlyph}
3+
4+
25
{ImFontGlyph}
36

47
function ImFontGlyph.GetData0Value(const AIndex: Integer): Cardinal;
@@ -21,6 +24,28 @@ begin
2124
Data0 := (Data0 and (not (Mask shl Offset))) or (AValue shl Offset);
2225
end;
2326

27+
{ImGuiBoxSelectState}
28+
29+
function ImGuiBoxSelectState.GetData0Value(const AIndex: Integer): Cardinal;
30+
var
31+
BitCount, Offset, Mask: Cardinal;
32+
begin
33+
BitCount := AIndex and $FF;
34+
Offset := AIndex shr 8;
35+
Mask := ((1 shl BitCount) - 1);
36+
Result := (Data0 shr Offset) and Mask;
37+
end;
38+
39+
procedure ImGuiBoxSelectState.SetData0Value(const AIndex: Integer; const AValue: Cardinal);
40+
var
41+
BitCount, Offset, Mask: Cardinal;
42+
begin
43+
BitCount := AIndex and $FF;
44+
Offset := AIndex shr 8;
45+
Mask := ((1 shl BitCount) - 1);
46+
Data0 := (Data0 and (not (Mask shl Offset))) or (AValue shl Offset);
47+
end;
48+
2449
{ImGuiDockNode}
2550

2651
function ImGuiDockNode.GetData0Value(const AIndex: Integer): Cardinal;

0 commit comments

Comments
 (0)