Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glow-extras
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glow
glow-extras
Commits
00323a8e
Commit
00323a8e
authored
5 years ago
by
Jonathan Kunstwald
Browse files
Options
Downloads
Patches
Plain Diff
Add ImGui::Combo and ListBox utilities for tg::span
parent
de205c59
No related branches found
No related tags found
1 merge request
!67
Add ImGui::Combo and ListBox utilities for tg::span
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
debugging/glow-extras/debugging/imgui-util.cc
+25
-0
25 additions, 0 deletions
debugging/glow-extras/debugging/imgui-util.cc
debugging/glow-extras/debugging/imgui-util.hh
+12
-3
12 additions, 3 deletions
debugging/glow-extras/debugging/imgui-util.hh
with
37 additions
and
3 deletions
debugging/glow-extras/debugging/imgui-util.cc
+
25
−
0
View file @
00323a8e
...
@@ -3,6 +3,17 @@
...
@@ -3,6 +3,17 @@
#include
<imgui/imgui.h>
#include
<imgui/imgui.h>
namespace
{
bool
span_getter
(
void
*
data
,
int
i
,
const
char
**
out
)
{
if
(
i
<
0
)
return
false
;
*
out
=
static_cast
<
std
::
string
*>
(
data
)[
unsigned
(
i
)].
c_str
();
return
true
;
};
}
void
glow
::
debugging
::
applyGlowImguiTheme
(
bool
darkMode
)
void
glow
::
debugging
::
applyGlowImguiTheme
(
bool
darkMode
)
{
{
ImGuiStyle
&
style
=
ImGui
::
GetStyle
();
ImGuiStyle
&
style
=
ImGui
::
GetStyle
();
...
@@ -144,4 +155,18 @@ void glow::debugging::applyGlowImguiTheme(bool darkMode)
...
@@ -144,4 +155,18 @@ void glow::debugging::applyGlowImguiTheme(bool darkMode)
#endif
#endif
}
}
bool
glow
::
debugging
::
imgui
::
Combo
(
char
const
*
label
,
int
*
currIndex
,
tg
::
span
<
std
::
string
>
values
)
{
if
(
values
.
empty
())
return
false
;
return
::
ImGui
::
Combo
(
label
,
currIndex
,
span_getter
,
values
.
data
(),
int
(
values
.
size
()));
}
bool
glow
::
debugging
::
imgui
::
ListBox
(
char
const
*
label
,
int
*
currIndex
,
tg
::
span
<
std
::
string
>
values
)
{
if
(
values
.
empty
())
return
false
;
return
::
ImGui
::
ListBox
(
label
,
currIndex
,
span_getter
,
values
.
data
(),
int
(
values
.
size
()));
}
#endif
#endif
This diff is collapsed.
Click to expand it.
debugging/glow-extras/debugging/imgui-util.hh
+
12
−
3
View file @
00323a8e
...
@@ -2,11 +2,20 @@
...
@@ -2,11 +2,20 @@
#ifdef GLOW_EXTRAS_HAS_IMGUI
#ifdef GLOW_EXTRAS_HAS_IMGUI
namespace
glow
#include
<string>
{
namespace
debugging
#include
<typed-geometry/types/span.hh>
namespace
glow
::
debugging
{
{
void
applyGlowImguiTheme
(
bool
darkMode
=
false
);
void
applyGlowImguiTheme
(
bool
darkMode
=
false
);
namespace
imgui
{
/// ImGui::Combo for array_like<string>
bool
Combo
(
const
char
*
label
,
int
*
currIndex
,
tg
::
span
<
std
::
string
>
values
);
/// ImGui::ListBox for array_like<string>
bool
ListBox
(
const
char
*
label
,
int
*
currIndex
,
tg
::
span
<
std
::
string
>
values
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment