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
1902248e
Commit
1902248e
authored
3 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
start of asset loading
parent
6109d35b
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/data/res/.gitignore
+2
-0
2 additions, 0 deletions
demo/data/res/.gitignore
demo/data/res/demo/manifest.yml
+3
-0
3 additions, 0 deletions
demo/data/res/demo/manifest.yml
demo/main.cpp
+29
-1
29 additions, 1 deletion
demo/main.cpp
with
34 additions
and
1 deletion
demo/data/res/.gitignore
0 → 100644
+
2
−
0
View file @
1902248e
# non-free (non-CC) assets for testing
nonfree/
This diff is collapsed.
Click to expand it.
demo/data/res/demo/manifest.yml
0 → 100644
+
3
−
0
View file @
1902248e
---
id
:
"
com.fossgalaxy.games.demo"
name
:
"
Demo
Content
Pack"
This diff is collapsed.
Click to expand it.
demo/main.cpp
+
29
−
1
View file @
1902248e
#include
<filesystem>
#include
<iostream>
#include
<fggl/gfx/window.hpp>
#include
<fggl/gfx/ogl.hpp>
#include
<fggl/gfx/renderer.hpp>
...
...
@@ -10,6 +10,30 @@
#include
<fggl/debug/debug.h>
#include
<fggl/data/storage.hpp>
// prototype of resource discovery
void
discover
(
std
::
filesystem
::
path
base
)
{
std
::
vector
<
std
::
filesystem
::
path
>
contentPacks
;
for
(
auto
&
item
:
std
::
filesystem
::
directory_iterator
(
base
)
)
{
// content pack detection
if
(
std
::
filesystem
::
is_directory
(
item
)
)
{
auto
manifest
=
item
.
path
()
/
"manifest.yml"
;
if
(
std
::
filesystem
::
exists
(
manifest
)
)
{
contentPacks
.
push_back
(
item
.
path
()
);
}
}
}
// what did we find?
std
::
cerr
<<
"found pack(s): "
<<
std
::
endl
;
for
(
auto
&
pack
:
contentPacks
)
{
std
::
cerr
<<
pack
<<
std
::
endl
;
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
fggl
::
gfx
::
Context
ctx
;
...
...
@@ -21,10 +45,14 @@ int main(int argc, char* argv[]) {
fggl
::
gfx
::
Graphics
ogl
(
win
);
fggl
::
gfx
::
MeshRenderer
meshRenderer
;
// debug layer
fggl
::
debug
::
DebugUI
debug
(
win
);
debug
.
visible
(
false
);
// storage API
fggl
::
data
::
Storage
storage
;
discover
(
storage
.
resolvePath
(
fggl
::
data
::
Data
,
"res"
)
);
fggl
::
gfx
::
ShaderCache
cache
(
storage
);
fggl
::
gfx
::
ShaderConfig
config
;
...
...
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