libGumball 0.0.2
C23-Based, libGimbal-powered UI Library
Loading...
Searching...
No Matches
gumball_manager.h
Go to the documentation of this file.
1#ifndef GUM_MANAGER_H
2#define GUM_MANAGER_H
3
4// View this file's documentation online: https://libgumball.psyops.studio/gumball__manager_8h.html
5
6/*! \file
7 * \ingroup core
8 *
9 * GUM_Manager is a resource manager for libGumball.
10 * It is used to load resources, returning refcounted pointers to them.
11 *
12 * \todo
13 * - Add support for audio
14 * - Back resources with a GblArena
15 *
16 * \author 2025 Agustín Bellagamba
17 * \copyright MIT License
18*/
19
20#include <gimbal/gimbal_meta.h>
21#include <gumball/ifaces/gumball_iresource.h>
22
23
24#define GUM_MANAGER_TYPE (GBL_TYPEID(GUM_Manager)) //!< Returns the GUM_Manager Type UUID
25#define GBL_SELF_TYPE GUM_Manager
26
27GBL_DECLS_BEGIN
28GBL_FORWARD_DECLARE_STRUCT(GUM_Manager);
29
30/*! \struct GUM_ManagerClass
31 * \extends GblStaticClass
32 * \brief GUM_Manager structure
33 *
34 * GUM_ManagerClass derives from GblStaticClass, adding nothing new.
35 *
36*/
37//! \cond
38GBL_STATIC_CLASS_DERIVE_EMPTY(GUM_Manager)
39
40GblType GUM_Manager_type(void);
41//! \endcond
42
43//! Loads a resource from the given path, and stores it in the internal hashset. If the resource has already been loaded, returns a reference to the existing resource.
44GBL_EXPORT GUM_IResource *GUM_Manager_load(GblStringRef *path) GBL_NOEXCEPT;
45
46//! Unloads a resource from the manager, removing it from the internal hashset.
47GBL_EXPORT void GUM_Manager_unload(GUM_IResource *pResource) GBL_NOEXCEPT;
48
49GBL_DECLS_END
50#undef GBL_SELF_TYPE
51
52#endif // GUM_MANAGER_H
GBL_EXPORT void GUM_Manager_unload(GUM_IResource *pResource) GBL_NOEXCEPT
Unloads a resource from the manager, removing it from the internal hashset.