Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 Crash when use Group::reallocate()

Go down 
2 posters
AuthorMessage
terror
Guest




Crash when use Group::reallocate() Empty
PostSubject: Crash when use Group::reallocate()   Crash when use Group::reallocate() Icon_minitimeThu Mar 25, 2010 1:51 pm

Hi, my question concerning function SPK:: Group::reallocate () when I cause it, the program crash. It is a problem in the function or it is necessary to make something before it to cause?
Back to top Go down
Juff
Developer



Messages : 539
Date d'inscription : 2009-07-14
Age : 42

Crash when use Group::reallocate() Empty
PostSubject: Re: Crash when use Group::reallocate()   Crash when use Group::reallocate() Icon_minitimeSun Mar 28, 2010 12:42 pm

Hi,

I will take a look at the code to check that.

But be aware that with a regular use of the engine, you normally dont have to call the reallocate method as it is slow (every arrays of data have to be recreated). Your groups should be built with their maximum capacity at construction and never be reallocated after that.

Anyway, i will check that.

Thanks for reporting.
Back to top Go down
http://spark.developpez.com
Terror




Messages : 2
Date d'inscription : 2010-03-27
Age : 39

Crash when use Group::reallocate() Empty
PostSubject: Re: Crash when use Group::reallocate()   Crash when use Group::reallocate() Icon_minitimeSun Mar 28, 2010 1:43 pm

Thanks for the answer.
I use this function only in the editor.
As not always you know how many a maximum it is required on this or that effect. I have looked your code and have a little altered function, I am not assured that it correctly, but it works for me. I have added pool.clear (); and program falling have stopped. I use DX9Renderer and consequently it was necessary to make some changes to it.
1) has added DX9DestroyBuffers (group);
void DX9QuadRenderer:: destroyBuffers (const Group AND group)
{
group.destroyBuffer (VERTEX_BUFFER_NAME);
group.destroyBuffer (COLOR_BUFFER_NAME);
group.destroyBuffer (TEXTURE_BUFFER_NAME);
group.destroyBuffer (INDEX_BUFFER_NAME);
offsetIndex = 0;
DX9DestroyBuffers (group);
}
2) has changed in places in render () prepareBuffers () and DX9PrepareBuffers ()
void DX9QuadRenderer:: render (const Group AND group)
{
HRESULT hr = 0;
int nb_part = group.getNbParticles ();

if (! prepareBuffers (group))
return;

if (! DX9PrepareBuffers (group))
return;

D3DXMATRIX view;
...
}

Still I had problems with Model:: getParamValue (), I could not receive last parametre. I have corrected so:
float Model:: getParamValue (ModelParam type, size_t index) const
{
unsigned int nbValues = getNbValues (type);

if ((nbValues - 1> = index) && (nbValues! = 0))
return params [indices [type] + index];

return DEFAULT_VALUES [type];
}
Probably it was possible and so to make
if ((nbValues> index) && (nbValues! = 0))
Back to top Go down
Juff
Developer



Messages : 539
Date d'inscription : 2009-07-14
Age : 42

Crash when use Group::reallocate() Empty
PostSubject: Re: Crash when use Group::reallocate()   Crash when use Group::reallocate() Icon_minitimeFri Apr 02, 2010 1:34 pm

Hi,

yes you are right for the reallocate and the getParamValue stuff, I will fix them on the svn.

Regarding the directX9 issue, the module is not considered as stable at the moment and will be rebuilt with the version 2 of spark to come, so I dont touch it at the moment.

Thanks
Back to top Go down
http://spark.developpez.com
Sponsored content





Crash when use Group::reallocate() Empty
PostSubject: Re: Crash when use Group::reallocate()   Crash when use Group::reallocate() Icon_minitime

Back to top Go down
 
Crash when use Group::reallocate()
Back to top 
Page 1 of 1
 Similar topics
-
» Renderer Crash
» spark2 crash HELP
» crash and leaks or bugs? :).
» Crash lors du lancement .....
» spark explosion demo crash-vs2010-opengl-sdl

Permissions in this forum:You cannot reply to topics in this forum
 :: English Forum :: Evolution (en)-
Jump to: