Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Nicolas Pope
ftl
Commits
dec9e8d9
Commit
dec9e8d9
authored
4 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Limit GUI redraw rate
parent
4d2cee76
No related branches found
No related tags found
1 merge request
!316
Resolves #343 GUI and Frame Refactor
Pipeline
#28513
failed
4 years ago
Stage: all
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/gui2/src/main.cpp
+6
-6
6 additions, 6 deletions
applications/gui2/src/main.cpp
with
6 additions
and
6 deletions
applications/gui2/src/main.cpp
+
6
−
6
View file @
dec9e8d9
...
@@ -106,7 +106,7 @@ void FTLGui::mainloop() {
...
@@ -106,7 +106,7 @@ void FTLGui::mainloop() {
screen_
->
setVisible
(
true
);
screen_
->
setVisible
(
true
);
screen_
->
drawAll
();
screen_
->
drawAll
();
//
float last_draw_time = 0.0f;
float
last_draw_time
=
0.0
f
;
while
(
ftl
::
running
)
{
while
(
ftl
::
running
)
{
if
(
!
screen_
->
visible
())
{
if
(
!
screen_
->
visible
())
{
...
@@ -117,8 +117,8 @@ void FTLGui::mainloop() {
...
@@ -117,8 +117,8 @@ void FTLGui::mainloop() {
ftl
::
running
=
false
;
ftl
::
running
=
false
;
}
}
else
{
else
{
//
float now = float(glfwGetTime());
float
now
=
float
(
glfwGetTime
());
//
float delta = now - last_draw_time;
float
delta
=
now
-
last_draw_time
;
// Generate poses and render and virtual frame here
// Generate poses and render and virtual frame here
// at full FPS (25 without VR and 90 with VR currently)
// at full FPS (25 without VR and 90 with VR currently)
...
@@ -127,10 +127,10 @@ void FTLGui::mainloop() {
...
@@ -127,10 +127,10 @@ void FTLGui::mainloop() {
io_
->
feed
()
->
render
();
io_
->
feed
()
->
render
();
// Only draw the GUI at 25fps
// Only draw the GUI at 25fps
//
if (delta >= 0.04f) {
if
(
delta
>=
0.04
f
)
{
//
last_draw_time = now;
last_draw_time
=
now
;
screen_
->
drawAll
();
screen_
->
drawAll
();
//
}
}
}
}
// Wait for mouse/keyboard or empty refresh events
// Wait for mouse/keyboard or empty refresh events
...
...
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