Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Commits
5963db9f
Commit
5963db9f
authored
5 years ago
by
Jeremy Whiting
Browse files
Options
Downloads
Patches
Plain Diff
Use srt_enum_value_to_nick in graphics string accessors.
parent
79b38e17
No related branches found
No related tags found
1 merge request
!90
Make stringification of enums, flags less repetitive
Pipeline
#2112
passed
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
steam-runtime-tools/graphics-internal.h
+13
-11
13 additions, 11 deletions
steam-runtime-tools/graphics-internal.h
with
13 additions
and
11 deletions
steam-runtime-tools/graphics-internal.h
+
13
−
11
View file @
5963db9f
...
...
@@ -27,6 +27,7 @@
#pragma once
#include
"steam-runtime-tools/steam-runtime-tools.h"
#include
"steam-runtime-tools/utils-internal.h"
/*
* _srt_graphics_new:
...
...
@@ -117,24 +118,25 @@ static inline int _srt_graphics_hash_key(SrtWindowSystem window_system,
static
inline
const
gchar
*
_srt_graphics_window_system_string
(
SrtWindowSystem
window_system
)
{
if
(
window_system
==
SRT_WINDOW_SYSTEM_X11
)
return
"x11"
;
else
if
(
window_system
==
SRT_WINDOW_SYSTEM_GLX
)
return
"glx"
;
else
if
(
window_system
==
SRT_WINDOW_SYSTEM_EGL_X11
)
const
gchar
*
result
=
srt_enum_value_to_nick
(
SRT_TYPE_WINDOW_SYSTEM
,
window_system
);
if
(
window_system
==
SRT_WINDOW_SYSTEM_EGL_X11
)
return
"egl_x11"
;
if
(
result
!=
NULL
)
return
result
;
return
"unknown window system"
;
}
static
inline
const
gchar
*
_srt_graphics_rendering_interface_string
(
SrtRenderingInterface
rendering_interface
)
{
if
(
rendering_interface
==
SRT_RENDERING_INTERFACE_GL
)
return
"gl"
;
else
if
(
rendering_interface
==
SRT_RENDERING_INTERFACE_GLESV2
)
return
"glesv2"
;
else
if
(
rendering_interface
==
SRT_RENDERING_INTERFACE_VULKAN
)
return
"vulkan"
;
const
gchar
*
result
=
srt_enum_value_to_nick
(
SRT_TYPE_RENDERING_INTERFACE
,
rendering_interface
);
if
(
result
!=
NULL
)
return
result
;
return
"unknown rendering interface"
;
}
...
...
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