aboutsummaryrefslogtreecommitdiff
path: root/src/example
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-24 10:46:32 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-24 10:46:32 +0200
commit5447ddd896eb49ea9fd9f9191a277fd1d5730aa3 (patch)
tree96e09b8fb5d757aafef33da50a93204bae54ba9f /src/example
parent0b08b742fffa63188c89d760a5aecd55d585403b (diff)
add PR #9 comments as code comments
Diffstat (limited to 'src/example')
-rw-r--r--src/example/asset_manager.cpp8
-rw-r--r--src/example/particle.cpp1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/example/asset_manager.cpp b/src/example/asset_manager.cpp
index 7aa4ffe..7e15d1f 100644
--- a/src/example/asset_manager.cpp
+++ b/src/example/asset_manager.cpp
@@ -8,12 +8,18 @@ using namespace crepe;
using namespace crepe::api;
int main() {
- // this needs to be called before the asset manager otherwise the destructor of sdl is not in the right order
+ // this needs to be called before the asset manager otherwise the destructor
+ // of sdl is not in the right order
{ Texture test("../asset/texture/img.png"); }
+ // FIXME: make it so the issue described by the above comment is not possible
+ // (i.e. the order in which internal classes are instantiated should not
+ // impact the way the engine works).
auto & mgr = AssetManager::get_instance();
{
+ // TODO: [design] the Sound class can't be directly included by the user as
+ // it includes SoLoud headers.
auto bgm = mgr.cache<Sound>("../mwe/audio/bgm.ogg");
auto sfx1 = mgr.cache<Sound>("../mwe/audio/sfx1.wav");
auto sfx2 = mgr.cache<Sound>("../mwe/audio/sfx2.wav");
diff --git a/src/example/particle.cpp b/src/example/particle.cpp
index 943f83b..53fa213 100644
--- a/src/example/particle.cpp
+++ b/src/example/particle.cpp
@@ -27,6 +27,7 @@ int main(int argc, char * argv[]) {
GameObject * game_object[1];
game_object[0] = new GameObject(0, "Name", "Tag", 0);
+ // FIXME: all systems are singletons, so this shouldn't even compile.
ParticleSystem particle_system;
unsigned int max_particles = 100; // maximum number of particles