Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
Home exam in IMT2531 - Graphics programming.
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
Model registry
Operate
Environments
Monitor
Incidents
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jone Skaara
Home exam in IMT2531 - Graphics programming.
Commits
960a534e
Commit
960a534e
authored
7 years ago
by
JonShard
Browse files
Options
Downloads
Patches
Plain Diff
Added toggeling of day and season moving bools.
parent
fd6a6035
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/overkill/Input.hpp
+2
-1
2 additions, 1 deletion
include/overkill/Input.hpp
src/Input.cpp
+15
-7
15 additions, 7 deletions
src/Input.cpp
with
17 additions
and
8 deletions
include/overkill/Input.hpp
+
2
−
1
View file @
960a534e
...
...
@@ -26,7 +26,8 @@ class Input
private:
static
bool
m_leftButtonDown
;
static
bool
m_rightButtonDown
;
static
bool
m_dayMoving
;
static
bool
m_seasonMoving
;
public:
static
float
m_fovy
;
// The camera's field of view on Y axis. Used for zoom.
...
...
This diff is collapsed.
Click to expand it.
src/Input.cpp
+
15
−
7
View file @
960a534e
...
...
@@ -5,6 +5,8 @@ namespace overkill
{
bool
Input
::
m_leftButtonDown
=
false
;
bool
Input
::
m_rightButtonDown
=
false
;
bool
Input
::
m_dayMoving
=
true
;
bool
Input
::
m_seasonMoving
=
true
;
float
Input
::
m_fovy
=
C
::
FOV
;
float
Input
::
m_cursorX
=
0
;
...
...
@@ -85,7 +87,10 @@ namespace overkill
}
// PRESS 5 TO Set toggle season changing.
else
if
(
keyCode
==
GLFW_KEY_5
)
{
// toggle season change
if
(
m_seasonMoving
)
m_seasonMoving
=
false
;
else
m_seasonMoving
=
true
;
}
// PRESS 6 TO change daytime to morning.
...
...
@@ -106,7 +111,10 @@ namespace overkill
}
// PRESS 0 TO toggle daytime changing.
else
if
(
keyCode
==
GLFW_KEY_0
)
{
if
(
m_dayMoving
)
m_dayMoving
=
false
;
else
m_dayMoving
=
true
;
}
...
...
@@ -209,10 +217,10 @@ namespace overkill
m_navKeyPressed
[
Y
]
=
false
;
break
;
case
GLFW_KEY_N
:
m_navKeyPressed
[
N
]
=
false
;
break
;
case
GLFW_KEY_M
:
m_navKeyPressed
[
M
]
=
false
;
m_navKeyPressed
[
N
]
=
false
/
PRESS
SHIFT
+
4
TO
RELOAD
Scene
;
break
;
else
if
(
keyCode
==
GLFW_KEY_4
&&
mods
==
GLFW_MOD_SHIFT
)
{
case
GLFW_KEY_M
:
Scene
::
reload
();
m_navKeyPressed
[
M
]
=
false
}
;
break
;
}
}
...
...
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