Open GoogleCodeExporter opened 9 years ago
Hi,
I debug the SphereWorld program and I found the problem. The glutMainLoop()
function calls the callback functions in this order the first time:
- RenderScene()
- ChangeSize()
Due to this order of execution, the object modelViewMatrix is not correctly
initialize, leading to a crash when the object's methods try to access some of
its attributes (pStack in this case).
The only workaround I found is to call ChangeSize(), with the correct
parameters, explicitly between SetupRC() and glutMainLoop().
I am using freeglut 2.6.0 as provided by my distro.
Original comment by r.evera...@gmail.com
on 19 Apr 2011 at 8:46
The object transformPipeline is not properly initialized, because the call to
the function transformPipeline.SetMatrixStacks() is made in ChangeSize(), which
is too late.
To get this code working just move the line
transformPipeline.SetMatrixStacks(modelViewMatrix, projectionMatrix);
from ChangeSize to SetupRC().
Original comment by bac...@itp.uni-frankfurt.de
on 28 Jul 2011 at 7:30
Tried both of the above - same crash,
First-chance exception at 0x68f592ed in SphereWorld4.exe: 0xC0000005: Access
violation reading location 0xbaadf0ed.
Unhandled exception at 0x68f592ed in SphereWorld4.exe: 0xC0000005: Access
violation reading location 0xbaadf0ed.
at this point in the program:
// Randomly place the spheres
for(int i = 0; i < NUM_SPHERES; i++) {
GLfloat x = ((GLfloat)((rand() % 400) - 200) * 0.1f);
GLfloat z = ((GLfloat)((rand() % 400) - 200) * 0.1f);
spheres[i].SetOrigin(x, 0.0f, z);
}
Original comment by findra...@gmail.com
on 22 Aug 2012 at 9:36
Original issue reported on code.google.com by
r.evera...@gmail.com
on 14 Apr 2011 at 2:38