Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Game Library
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
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Onuralp SEZER
Game Library
Commits
9b916e92
Commit
9b916e92
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
ensure game scenes without cameras do not crash
parent
87f26504
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fggl/gfx/ogl/renderer.cpp
+5
-1
5 additions, 1 deletion
fggl/gfx/ogl/renderer.cpp
fggl/scenes/game.cpp
+2
-0
2 additions, 0 deletions
fggl/scenes/game.cpp
with
7 additions
and
1 deletion
fggl/gfx/ogl/renderer.cpp
+
5
−
1
View file @
9b916e92
...
...
@@ -207,7 +207,11 @@ namespace fggl::gfx {
if
(
m_debugRenderer
)
{
auto
cameras
=
world
.
findMatching
<
gfx
::
Camera
>
();
auto
cameraEnt
=
cameras
[
0
];
if
(
cameras
.
empty
()
)
{
return
;
}
auto
cameraEnt
=
cameras
.
front
();
auto
*
const
camTransform
=
world
.
get
<
math
::
Transform
>
(
cameraEnt
);
auto
*
const
camComp
=
world
.
get
<
gfx
::
Camera
>
(
cameraEnt
);
...
...
This diff is collapsed.
Click to expand it.
fggl/scenes/game.cpp
+
2
−
0
View file @
9b916e92
...
...
@@ -43,6 +43,8 @@ namespace fggl::scenes {
}
void
Game
::
update
()
{
assert
(
m_world
);
if
(
m_input
!=
nullptr
)
{
bool
escapePressed
=
m_input
->
keyboard
.
pressed
(
glfwGetKeyScancode
(
GLFW_KEY_ESCAPE
));
if
(
escapePressed
)
{
...
...
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