Windows has triggered a breakpoint in Ballistic.exe.
This may be due to a corruption of the heap, and indicates a bug in Ballistic.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information Here is the code:
Image::Image(const Image& copy) {
this->width = copy.width;
this->height = copy.height;
// Copy texture data and create a new texture
unsigned char* temp = new unsigned char[width*height*4];
glBindTexture(GL_TEXTURE_2D, copy.texId);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, temp);
this->texId = SOIL_create_OGL_texture(temp, width, height,
SOIL_LOAD_RGBA, SOIL_CREATE_NEW_ID,
SOIL_FLAG_TEXTURE_REPEATS);
//### Error happens in here ###
SOIL_free_image_data(temp); // Delete temporary data
}
Unhandled exception at 0x7c812aeb in Ballistic.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012f698.. That doesn't sound good but it means that the problem is not localised to some piece of code, there must be a memory leak somewhere or something. Quite a while ago, then i was working on the GUI for my game, i discovered that i was getting a null pointer exception when creating one of the windows (not an OS window, just one of my objects). It was a static class variable that was used for the text font. This variable was initialised earlier and shouldn't have been deleted, so i figured it was a memory problem. I put it on the back-burner until i had time to fix it. Well i have a feeling that it might be causing this too. Of course, i don't expect anyone to fix it for me, but i was wondering if there are any ways to try and target where the cause of the problem is. I can use Visual Studio's debugger to see the value of the font variable at points in the execution of the program but i can't see where it is being changed. Basically, i am posting here as a last resort. I've tried nothin' and i'm all out of ideas! (that was from The Simpsons [grin]) thanks