Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
graphicsframework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Oliver Behnke
graphicsframework
Commits
775387a4
Commit
775387a4
authored
17 years ago
by
Oliver Bock
Browse files
Options
Downloads
Patches
Plain Diff
Optimized HUD (reduced operations during rendering, removed days in CPU time)
parent
1b098a4c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Starsphere.cpp
+22
-24
22 additions, 24 deletions
Starsphere.cpp
with
22 additions
and
24 deletions
Starsphere.cpp
+
22
−
24
View file @
775387a4
...
...
@@ -647,22 +647,22 @@ void Starsphere::render(const double timeOfDay)
glColor4f
(
1.0
,
1.0
,
1.0
,
0.5
);
glTranslatef
(
xStartPosLeft
,
yStartPosBottom
-
yOffsetMedium
,
0
);
glScalef
(
fontScaleSmall
,
fontScaleSmall
,
1.0
);
m_PolygonFont
->
Render
(
string
(
"User: "
+
m_UserName
)
.
c_str
());
m_PolygonFont
->
Render
(
m_UserName
.
c_str
());
glLoadIdentity
();
glTranslatef
(
xStartPosLeft
,
yStartPosBottom
-
2
*
yOffsetMedium
,
0
);
glScalef
(
fontScaleSmall
,
fontScaleSmall
,
1.0
);
m_PolygonFont
->
Render
(
string
(
"Team: "
+
m_TeamName
)
.
c_str
());
m_PolygonFont
->
Render
(
m_TeamName
.
c_str
());
glLoadIdentity
();
glTranslatef
(
xStartPosLeft
,
yStartPosBottom
-
3
*
yOffsetMedium
,
0
);
glScalef
(
fontScaleSmall
,
fontScaleSmall
,
1.0
);
m_PolygonFont
->
Render
(
string
(
"Project Credit: "
+
m_UserCredit
)
.
c_str
());
m_PolygonFont
->
Render
(
m_UserCredit
.
c_str
());
glLoadIdentity
();
glTranslatef
(
xStartPosLeft
,
yStartPosBottom
-
4
*
yOffsetMedium
,
0
);
glScalef
(
fontScaleSmall
,
fontScaleSmall
,
1.0
);
m_PolygonFont
->
Render
(
string
(
"Project RAC: "
+
m_UserRACredit
)
.
c_str
());
m_PolygonFont
->
Render
(
m_UserRACredit
.
c_str
());
glPopMatrix
();
...
...
@@ -678,22 +678,22 @@ void Starsphere::render(const double timeOfDay)
glColor4f
(
1.0
,
1.0
,
1.0
,
0.5
);
glTranslatef
(
xStartPosRight
,
yStartPosBottom
-
yOffsetMedium
,
0
);
glScalef
(
fontScaleSmall
,
fontScaleSmall
,
1.0
);
m_PolygonFont
->
Render
(
string
(
"Ascension: "
+
m_WUSkyPosRightAscension
+
" deg"
)
.
c_str
());
m_PolygonFont
->
Render
(
m_WUSkyPosRightAscension
.
c_str
());
glLoadIdentity
();
glTranslatef
(
xStartPosRight
,
yStartPosBottom
-
2
*
yOffsetMedium
,
0
);
glScalef
(
fontScaleSmall
,
fontScaleSmall
,
1.0
);
m_PolygonFont
->
Render
(
string
(
"Declination: "
+
m_WUSkyPosDeclination
+
" deg"
)
.
c_str
());
m_PolygonFont
->
Render
(
m_WUSkyPosDeclination
.
c_str
());
glLoadIdentity
();
glTranslatef
(
xStartPosRight
,
yStartPosBottom
-
3
*
yOffsetMedium
,
0
);
glScalef
(
fontScaleSmall
,
fontScaleSmall
,
1.0
);
m_PolygonFont
->
Render
(
string
(
"Completed: "
+
m_WUPercentDone
+
" %"
)
.
c_str
());
m_PolygonFont
->
Render
(
m_WUPercentDone
.
c_str
());
glLoadIdentity
();
glTranslatef
(
xStartPosRight
,
yStartPosBottom
-
4
*
yOffsetMedium
,
0
);
glScalef
(
fontScaleSmall
,
fontScaleSmall
,
1.0
);
m_PolygonFont
->
Render
(
string
(
"CPU Time: "
+
m_WUCPUTime
)
.
c_str
());
m_PolygonFont
->
Render
(
m_WUCPUTime
.
c_str
());
glPopMatrix
();
}
...
...
@@ -825,38 +825,36 @@ void Starsphere::refreshBOINCInformation()
buffer
.
setf
(
ios
::
right
,
ios
::
adjustfield
);
// store content required for our HUD (user info)
m_UserName
=
boincAdapter
.
userName
();
m_TeamName
=
boincAdapter
.
teamName
();
m_UserName
=
"User: "
+
boincAdapter
.
userName
();
m_TeamName
=
"Team: "
+
boincAdapter
.
teamName
();
buffer
<<
fixed
<<
boincAdapter
.
userCredit
()
<<
ends
;
buffer
<<
"Project Credit: "
<<
fixed
<<
boincAdapter
.
userCredit
()
<<
ends
;
m_UserCredit
=
buffer
.
str
();
buffer
.
str
(
""
);
buffer
<<
fixed
<<
boincAdapter
.
userRACredit
()
<<
ends
;
buffer
<<
"Project RAC: "
<<
fixed
<<
boincAdapter
.
userRACredit
()
<<
ends
;
m_UserRACredit
=
buffer
.
str
();
buffer
.
str
(
""
);
// store content required for our HUD (search info)
buffer
<<
fixed
<<
boincAdapter
.
wuSkyPosRightAscension
()
*
360
/
PI2
<<
ends
;
buffer
<<
"Ascension: "
<<
fixed
<<
boincAdapter
.
wuSkyPosRightAscension
()
*
360
/
PI2
<<
" deg"
<<
ends
;
m_WUSkyPosRightAscension
=
buffer
.
str
();
buffer
.
str
(
""
);
buffer
<<
fixed
<<
boincAdapter
.
wuSkyPosDeclination
()
*
360
/
PI2
<<
ends
;
buffer
<<
"Declination: "
<<
fixed
<<
boincAdapter
.
wuSkyPosDeclination
()
*
360
/
PI2
<<
" deg"
<<
ends
;
m_WUSkyPosDeclination
=
buffer
.
str
();
buffer
.
str
(
""
);
buffer
<<
fixed
<<
boincAdapter
.
wuFractionDone
()
*
100
<<
ends
;
buffer
<<
"Completed: "
<<
fixed
<<
boincAdapter
.
wuFractionDone
()
*
100
<<
" %"
<<
ends
;
m_WUPercentDone
=
buffer
.
str
();
buffer
.
str
(
""
);
const
double
cputime
=
boincAdapter
.
wuCPUTime
();
const
int
day
=
cputime
/
86400
;
const
int
hrs
=
(
cputime
-
day
*
86400
)
/
3600
;
const
int
min
=
(
cputime
-
(
day
*
86400
+
hrs
*
3600
))
/
60
;
const
int
sec
=
cputime
-
(
day
*
86400
+
hrs
*
3600
+
min
*
60
);
const
int
hrs
=
cputime
/
3600
;
const
int
min
=
(
cputime
-
hrs
*
3600
)
/
60
;
const
int
sec
=
cputime
-
(
hrs
*
3600
+
min
*
60
);
buffer
<<
right
<<
setw
(
2
)
<<
day
<<
":"
<<
right
<<
setw
(
2
)
<<
hrs
<<
":"
buffer
<<
"CPU Time: "
<<
right
<<
setw
(
2
)
<<
hrs
<<
":"
<<
right
<<
setw
(
2
)
<<
min
<<
":"
<<
right
<<
setw
(
2
)
<<
sec
<<
ends
;
...
...
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