Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
chestotesto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
4TU
chestotesto
Commits
f6fa2e86
Commit
f6fa2e86
authored
5 years ago
by
CompuCat
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring, added rainbow background
parent
ba656090
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
chestoincludes.hpp
+0
-0
0 additions, 0 deletions
chestoincludes.hpp
libs/chesto
+1
-1
1 addition, 1 deletion
libs/chesto
main.cpp
+6
-2
6 additions, 2 deletions
main.cpp
with
7 additions
and
3 deletions
chestoincludes.h
→
chestoincludes.h
pp
+
0
−
0
View file @
f6fa2e86
File moved
This diff is collapsed.
Click to expand it.
chesto
@
a34302ef
Compare
023e4daa
...
a34302ef
Subproject commit
023e4daa18e46e0c73ffe0d6e0dc7dbc87373ea4
Subproject commit
a34302efa174d27967014b85f9c29ff95cb21773
This diff is collapsed.
Click to expand it.
main.cpp
+
6
−
2
View file @
f6fa2e86
#include
<cstdio>
#include
"chestoincludes.h"
#include
"chestoincludes.h
pp
"
bool
running
=
true
;
void
quit
(){
running
=
false
;}
...
...
@@ -36,10 +36,12 @@ int main(int argc, char* argv[])
display
->
elements
.
push_back
(
dumbButton
);
dumbButton
->
action
=
std
::
bind
(
printf
,
"Why on *earth* would you press the dumb button?
\n
"
);
hsv
backgroundColor
=
{
0
,
.55
,
.45
};
/*Main loop.*/
while
(
running
)
{
bool
atLeastOneNewEvent
=
false
;
bool
atLeastOneNewEvent
=
false
;
while
(
events
->
update
())
// get any new input events
{
display
->
process
(
events
);
// process the inputs of the supplied event
...
...
@@ -51,6 +53,8 @@ int main(int argc, char* argv[])
// This is imported from HBAS, wonder if it's even necessary?
if
(
!
atLeastOneNewEvent
)
events
->
update
();
backgroundColor
.
h
=
fmod
(
backgroundColor
.
h
+
0.2
,
360
);
display
->
backgroundColor
=
hsv2rgb
(
backgroundColor
);
display
->
render
(
NULL
);
//Render all the things.
//HBAS has a framelimiter here to avoid redrawing frames if there's no new input (or above 60fps).
//This currently requires direct SDL2 calls for timing, though.
...
...
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