Skip to content

feat: add a resource manager for loading textures#15

Merged
DedLad merged 7 commits intoacmpesuecc:mainfrom
Delta18-Git:feat/resource
May 24, 2025
Merged

feat: add a resource manager for loading textures#15
DedLad merged 7 commits intoacmpesuecc:mainfrom
Delta18-Git:feat/resource

Conversation

@Delta18-Git
Copy link
Copy Markdown
Member

@Delta18-Git Delta18-Git commented May 17, 2025

Which issue(s) does this PR address?

We until this PR were not able to load textures, and were unable to use sprites in any way due to this.

Why do we need this PR?

This PR makes it possible for us to load images for textures, allowing us to have sprites rendered. Loading assets is an integral part of a Game Engine, and this allows us to start implementing an Asset Manager.

What logical changes are present in this PR?

This PR adds Sprite loading using a ResourceManager object. This object has an interface for importing files, and lazily loading them when required. This currently only supports images for Textures and Sprites.

How did you test the changes in this PR?

This PR was tested using the code in tests/sprite_layer.cpp
See the following screen recording for a demonstration.

demo.mp4

Are there any breaking changes in this PR?

This PR adds the breaking change of introducing the ResourceManager object into the Engine class.

Is there some additional work to be done later that is NOT covered in this PR?

Additional work to be done later is for audio and font loading to be included with this object.

adds a resource manager for loading
and unloading assets, as well as for lazily creating textures
adds a test including sprite rendering
showcasing the enderable transformations
as well as the layer interactions
@@ -0,0 +1,180 @@
#include <SDL3/SDL_keycode.h>
Copy link
Copy Markdown
Contributor

@DedLad DedLad May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well written code, but i would like it if tests have no direct usage of SDL, because these are meant to serve as test examples, of what a user using the game engine would be writing with our framework and the engine itself, it would be nice if we minimize SDL usage directly, and provide abstractions and bindings to whatever the user would need as much as possible.
this would entail a well featured library/package abstracting over SDL or binding to SDL and other libraries to provide nicer easier framework to work with while coding a game using this project.
note, this is only a comment and views to where the project should go.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll continue updating the tests over time with the abstraction we add. At this point, there are a few SDL deps that we can't remove yet but are fairly important for a workable test. Will work on it.

@Delta18-Git
Copy link
Copy Markdown
Member Author

AABB collision reference

If required can add a video of the new example later.

@DedLad
Copy link
Copy Markdown
Contributor

DedLad commented May 24, 2025

AABB collision reference

If required can add a video of the new example later.

Yes that would be preferred

@Delta18-Git
Copy link
Copy Markdown
Member Author

Delta18-Git commented May 24, 2025

upload.mp4

Hope the video is clear. When the object is unable to move due to collision, there is a log output shown in the left terminal window in the recording. At times, during the recording, the log output wasn't updating as frequently leading to some small issues in clarity of the demo. Hope it is clear regardless.

@DedLad DedLad merged commit e37daca into acmpesuecc:main May 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants