GCubeSDK
©2026 FenixFox®Studios

Loader

Abstract base class for implementing loaders.

This class provides the foundation for all concrete loaders in the engine. It handles common loading functionality like path management, cross-origin settings, and integration with the LoadingManager.

All other loader classes inherit from this class

InheritanceDiagram node_AudioLoader AudioLoader node_GLTFLoader GLTFLoader node_Loader Loader node_Loader->node_AudioLoader node_Loader->node_GLTFLoader node_MTLLoader MTLLoader node_Loader->node_MTLLoader node_OBJLoader OBJLoader node_Loader->node_OBJLoader node_TextureLoader TextureLoader node_Loader->node_TextureLoader

Methods

Loader()

Default constructor - creates a loader with default settings

Loader(LoaderManager* manager)

Constructor with loading manager

manager Loading manager to use for this loader

binaryData* load(const string& url, OnLoadCallback onLoad, OnProgressCallback onProgress, OnErrorCallback onError)

Loads assets and returns binary data

url Path/URL of the file to be loaded
onLoad Callback executed when loading completes nullptr
onProgress Callback executed during loading progress nullptr
onError Callback executed when errors occur nullptr

virtual void* parse(const void* data)

Parses loaded data into engine entities

data Raw data to parse

void setCrossOrigin(const string& crossOrigin)

Sets the cross-origin string for CORS implementation

crossOrigin Cross-origin value (e.g., "anonymous")

void setWithCredentials(bool value)

Sets whether to use credentials in requests

value Whether to use credentials

void setPath(const string& path)

Sets the base path for asset loading

path Base path for assets

void setResourcePath(const string& resourcePath)

Sets the base path for dependent resources

resourcePath Base path for resources like textures

void setRequestHeader(const string& key, const string& value)

Sets a request header for HTTP requests

key Header name
value Header value

virtual void abort()

Aborts ongoing loading requests

Properties

isLoader bool Read
name string Optional display name
id u32 Unique identifier
uuid string UUID string
enabled bool Active/inactive
version u32 Bumps on change
manager LoaderManager * Loading manager instance
crossOrigin string Cross
withCredentials bool Whether to use credentials
path string Base path for assets
resourcePath string Base path for resources
requestHeader map<string,string> HTTP request headers