About vertex buffer copy

Started by
1 comment, last by zonozz 11 years, 2 months ago

Hi everyone, I'm a beginer of DirectX 11.I'm now coding for <Models manager>. I just use linear list to save loaded models, and I created 2 classes, one is "Model", another is "Models Manager", what I think is people can choose use manager or not, for example somewhere may be you want use model for 1 second ?

Question is :

1.I use class "Model" to create a object, and there must vertex data & index data in it. Now I should copy these data to "Model list" node, how to copy these data ?

2.Am I doing a right design ? Please tell me if I think in wrong way.

Thanks a lot !

Advertisement

Zonozz,

If you are asking "should I embed a reference to my Model class instance into my ModelManager Models list" and save it as a single file, I would say "no". Give a unique reference code to your Model instance, and keep a copy of that unique code in your ModelManager using list of model codes. This enables you to load and save the models and model manager seperately, as needed.

It this isn't what you are asking, then feel free to re-phrase your question - I maybe haven't understood what problem you are trying to solve.

Zonozz,

If you are asking "should I embed a reference to my Model class instance into my ModelManager Models list" and save it as a single file, I would say "no". Give a unique reference code to your Model instance, and keep a copy of that unique code in your ModelManager using list of model codes. This enables you to load and save the models and model manager seperately, as needed.

It this isn't what you are asking, then feel free to re-phrase your question - I maybe haven't understood what problem you are trying to solve.

Thanks for replying.

I'm now coding a ModelsManager, but before this I created a class named "Model" for saving 1 model temporary, now I want to add this temporary model to the manager's model list, when I try to copy vertex buffer & index buffer, I got memory error. And Im not mean saving model in single file, I mean should Engine forces users use models by manager ? I'm not sure this idea is in general.

This topic is closed to new replies.

Advertisement