but this gives me a Unhandled exeption at 0x6525ca8e... error. I cant begin to figure out how to debug it because I don't know what a Unhandled exception is.
What is it and why do I get one?
That error means that something, somewhere, threw an exception. Unless your debugger has a different definition of an exception, the code you posted isn't the cause. Exceptions are part of C++, not C.
If I take out the third section of code I don't get the error. So surely it must be the code. It compiles fine its just when I run it that I get the error. if it helps I'm using MVC++ 2010
Perhaps the graphics couldn't be loaded properly? You never check for a NULL value before you use texture in LoadGLTextures()..., so that may be the issue.
How do I check before loading the file. And I have tried a number of ways now to load the Textures and it appaers its the line SOIL_load_OGL_texture(filename, SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, NULL);
that is causing the problem. it seems to work fine in examples so i guess it must be the PNG files. So what am I doing wrong with them?
Yes, it defiantly does exist. In fact if I type the directory in wrong I don't get the error so i guess that proves it. I've decided to try a different texture loading program, DevIL.