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
6b7c48c2
Commit
6b7c48c2
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
prevent segfault when closing or clicking
parent
aaf609e9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
demo/demo/topdown.cpp
+5
-1
5 additions, 1 deletion
demo/demo/topdown.cpp
include/fggl/gfx/ogl/shader.hpp
+1
-1
1 addition, 1 deletion
include/fggl/gfx/ogl/shader.hpp
include/fggl/scenes/game.hpp
+5
-0
5 additions, 0 deletions
include/fggl/scenes/game.hpp
with
11 additions
and
2 deletions
demo/demo/topdown.cpp
+
5
−
1
View file @
6b7c48c2
...
...
@@ -137,6 +137,10 @@ void TopDown::update() {
}
void
TopDown
::
pick_object
()
{
if
(
!
hasPhys
())
{
return
;
}
auto
cameras
=
world
().
find
<
fggl
::
gfx
::
Camera
>
();
if
(
cameras
.
empty
()
)
{
return
;
...
...
@@ -152,7 +156,7 @@ void TopDown::pick_object() {
auto
ray
=
fggl
::
gfx
::
get_camera_ray
(
world
(),
cam
,
position
);
auto
hit
=
phys
().
raycast
(
ray
);
if
(
hit
!=
fggl
::
entity
::
INVALID
)
{
//
fggl::debug::
log
("hit: {}", hit);
fggl
::
debug
::
info
(
"hit: {}"
,
(
int
)
hit
);
}
else
{
fggl
::
debug
::
info
(
"no hit"
);
}
...
...
This diff is collapsed.
Click to expand it.
include/fggl/gfx/ogl/shader.hpp
+
1
−
1
View file @
6b7c48c2
...
...
@@ -82,7 +82,7 @@ namespace fggl::gfx {
void
initFallbackPipelines
();
private:
std
::
shared_ptr
<
fggl
::
data
::
Storage
>
m_storage
;
fggl
::
data
::
Storage
*
m_storage
;
std
::
unordered_map
<
std
::
string
,
GLuint
>
m_shaders
;
// extensions
...
...
This diff is collapsed.
Click to expand it.
include/fggl/scenes/game.hpp
+
5
−
0
View file @
6b7c48c2
...
...
@@ -41,7 +41,12 @@ namespace fggl::scenes {
return
*
m_world
;
}
bool
hasPhys
()
const
{
return
m_phys
!=
nullptr
;
}
inline
auto
phys
()
->
phys
::
PhysicsEngine
&
{
assert
(
m_phys
!=
nullptr
);
return
*
m_phys
;
}
...
...
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