Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glow-samples
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-samples
Commits
951cdb26
Commit
951cdb26
authored
1 year ago
by
Philip Trettner
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into 'develop'
add sample for cache_window_size See merge request
!18
parents
7370a5e2
f105e5e8
No related branches found
No related tags found
1 merge request
!18
add sample for cache_window_size
Pipeline
#24024
passed
1 year ago
Stage: Build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
extern/glow-extras
+1
-1
1 addition, 1 deletion
extern/glow-extras
samples/basic/viewer/main.cc
+30
-0
30 additions, 0 deletions
samples/basic/viewer/main.cc
with
31 additions
and
1 deletion
glow-extras
@
89472844
Subproject commit
db76c806b3df01907bab47d0c6f4cef17332156a
Subproject commit
89472844133cbf2b352e5ecbf0f7cce037ac817d
This diff is collapsed.
Click to expand it.
samples/basic/viewer/main.cc
+
30
−
0
View file @
951cdb26
...
@@ -1174,6 +1174,34 @@ void headless_screenshot(pm::vertex_attribute<tg::pos3> const& pos)
...
@@ -1174,6 +1174,34 @@ void headless_screenshot(pm::vertex_attribute<tg::pos3> const& pos)
gv
::
view
(
pos
);
gv
::
view
(
pos
);
}
}
void
cache_window_size
(
pm
::
vertex_attribute
<
tg
::
pos3
>
const
&
pos
)
{
// on closing the viewer, the window size and position are usually saved to and read from a
// glfwapp.ini file (and imgui.ini) in the current working directory
//
// this behavior can be changed using gv::cache_window_size(folder) or gv::no_cache_window_size
// -> gv::cache_window_size(folder) changes the folder for the .ini files
// - folder can be absolute (starting with "/") or relative to the CWD
// - the trailing "/" has no effect and is added automatically if it is not present
// - if the folder does not exist, a warning is emitted and the folder defaults to the CWD
// -> gv::no_cache_window_size disables creating or reading these files (same as gv::cache_window_size(""))
{
// to avoid the creation of additional files, this is disabled in this sample file
// auto cfg = gv::config(gv::cache_window_size("/my_folder_path/"));
auto
cfg
=
gv
::
config
(
gv
::
no_cache_window_size
);
gv
::
view
(
pos
,
"this window does not read or write .ini files for the window size"
);
}
{
// interactive viewers currently depend on GV_SCOPED_CONFIG
GV_SCOPED_CONFIG
(
gv
::
no_cache_window_size
);
gv
::
interactive
([
&
](){
gv
::
view
(
pos
,
"interactive version: this window does not read or write .ini files for the window size"
);
});
}
}
void
special_use_cases
(
pm
::
vertex_attribute
<
tg
::
pos3
>
const
&
pos
)
void
special_use_cases
(
pm
::
vertex_attribute
<
tg
::
pos3
>
const
&
pos
)
{
{
// TODO: decoupled camera
// TODO: decoupled camera
...
@@ -1397,6 +1425,8 @@ int main()
...
@@ -1397,6 +1425,8 @@ int main()
headless_screenshot
(
pos
);
headless_screenshot
(
pos
);
cache_window_size
(
pos
);
imguizmo
(
pos
);
imguizmo
(
pos
);
}
}
...
...
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