Skip to content

Commit

Permalink
port to table API
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Nov 18, 2022
1 parent f2b22e2 commit 17de258
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions ogre_mesh_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,23 @@
ROP2STR = ("ERROR", "Point List", "Line List", "Line Strip", "Triangle List", "Triangle Strip", "Triangle Fan")

def show_vertex_decl(decl):
ImGui.Columns(2)
ImGui.Text("Semantic")
ImGui.NextColumn()
ImGui.Text("Type")
ImGui.NextColumn()
ImGui.Separator()
flags = ImGui.ImGuiTableFlags_Borders | ImGui.ImGuiTableFlags_SizingStretchProp
if not ImGui.BeginTable("vertexDecl", 3, flags):
return
ImGui.TableSetupColumn("Semantic")
ImGui.TableSetupColumn("Type")
ImGui.TableSetupColumn("Buffer")
ImGui.TableHeadersRow()

for e in decl.getElements():
ImGui.TableNextRow()
ImGui.TableNextColumn()
ImGui.Text(VES2STR[e.getSemantic()])
ImGui.NextColumn()
ImGui.TableNextColumn()
ImGui.Text(VET2STR[e.getType()])
ImGui.NextColumn()
ImGui.Columns(1)
ImGui.TableNextColumn()
ImGui.Text(str(e.getSource()))
ImGui.EndTable()

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

0 comments on commit 17de258

Please sign in to comment.