Skip to content

Commit 17de258

Browse files
committed
port to table API
1 parent f2b22e2 commit 17de258

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

ogre_mesh_viewer.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,23 @@
2121
ROP2STR = ("ERROR", "Point List", "Line List", "Line Strip", "Triangle List", "Triangle Strip", "Triangle Fan")
2222

2323
def show_vertex_decl(decl):
24-
ImGui.Columns(2)
25-
ImGui.Text("Semantic")
26-
ImGui.NextColumn()
27-
ImGui.Text("Type")
28-
ImGui.NextColumn()
29-
ImGui.Separator()
24+
flags = ImGui.ImGuiTableFlags_Borders | ImGui.ImGuiTableFlags_SizingStretchProp
25+
if not ImGui.BeginTable("vertexDecl", 3, flags):
26+
return
27+
ImGui.TableSetupColumn("Semantic")
28+
ImGui.TableSetupColumn("Type")
29+
ImGui.TableSetupColumn("Buffer")
30+
ImGui.TableHeadersRow()
3031

3132
for e in decl.getElements():
33+
ImGui.TableNextRow()
34+
ImGui.TableNextColumn()
3235
ImGui.Text(VES2STR[e.getSemantic()])
33-
ImGui.NextColumn()
36+
ImGui.TableNextColumn()
3437
ImGui.Text(VET2STR[e.getType()])
35-
ImGui.NextColumn()
36-
ImGui.Columns(1)
38+
ImGui.TableNextColumn()
39+
ImGui.Text(str(e.getSource()))
40+
ImGui.EndTable()
3741

3842
def printable(str):
3943
return str.encode("utf-8", "replace").decode()

0 commit comments

Comments
 (0)