levelmeshes is a global declared as
The following function is supposed to initialise levelmeshes and perform some stuff on it.
The function itself runs fine, but when I try to use levelmeshes later on in the code, I get a segfault as though it has not been initialised. Im guessing this is something to do with the fact that levelmeshes is initialised only within the scope of this function?
I also tried to return the raw iMeshList pointer and assigning it to a csRef outside the function but this didnt work either.
Your help with this would be much appreciated!
levelmeshes = engine->GetMeshes(); //initialise levelmeshes
//Do stuff with meshes - works ok