int ObjectSpheres[50000];
int lavaShader = dbLoadEffect(\"media/GGLava01.fx\",1,0,1);
// Create a cube
int ObjectCube = dbCreateObjectCube(3);
for (int i =0;i<200;i++)
{
ObjectSpheres[i] = dbCreateObjectSphere(3,160,160);
dbPositionObject(ObjectSpheres[i],i-3,0,i+1);
dbSetObjectWireframe(ObjectSpheres[i],1);
dbSetObjectEffect(ObjectSpheres[i],lavaShader);
}
The last line inside the for loop is giving a runtime error -
Unhandled exception at 0x77bc15de in my_project.exe: 0xC0000005: Access violation reading location 0x25d83000.
If I use an integer or a single integer variable for the first parameter (objectID) within the function
dbSetObjectEffect(ObjectSpheres[i],lavaShader);
Then no error occurs at run time.
This works in Dark GDK 1.0 - that is passing object id as an element of an array of integer.
Can anybody help please.