Replies: 1 comment 4 replies
-
First of all, are you aware that The engine will create it's own device and resource manager internally by default unless you tell it not to by specifying your own objects in the device config. For the node graph, the engine is a node graph ( ma_engine_get_device()
ma_engine_get_resource_manager()
ma_engine_get_node_graph() Also, the With that out of the road, back to your main question. Do you mean you want a cache your objects and only initialize them when you need to? If so, this is just standard buffer management - just preallocate some memory for your objects and initialize them as necessary. Just make sure their address remains the same for their entire lifetime. To be honest, as a starting point just to get everything working at a basic level, I would just heap-allocate each individual object as needed and then once you've got it functional, then move on to optimizing. |
Beta Was this translation helpful? Give feedback.
-
I want to create a very simple multitrack recorder where after recording one sound to disk, I would like to record n additional sounds to disk and be able to play all of them back.
My setup uses these features tied together:
I load sounds via the resource manager, which needs a
ma_resource_manager_data_source object
, then I create a node which needs ama_data_source_node
and ama_resource_manager_data_source object
.How can I make multiple instances of these objects without knowing how many I will need ahead of time?
Should I declare a set number of data_source and source_node objects and manage their use, or is there some way to make these objects in an ad hoc fashion?
I suppose I could also make arrays of data_source and source_node and keep track of them with pointers? Just wondering if any of this makes sense.
Beta Was this translation helpful? Give feedback.
All reactions