I am loading TGA images using a class that I am making. Once the class is created, i create an instance in the initialize stage of my program, and make a texture from the loaded image. I am getting no compiler errors but my window flashes on and then off when i run the program. Here is some of the code I think is the problem..
Those bits point to the class using mySTGA as the instance. Really hope you guys can help as its got everyone baffled. Oh there is one thing that may help. When I debug each line it fails when it gets to the image data part of the instance. it says "Expression cannot be evaluated" but I cant see the cause of the problem.Code ://This is the class definition private: unsigned char* imageData; int height width etc... public: unsigned char* getImageData() { return imageData; } //Same for height and width bool STGA::loadTGA(const char *filename) { //loading function } //Now here is the texture bit from Init() glTexImage2D(GL_TEXTURE_2D, 0, 3,mySTGA.getImageWidth() , mySTGA.getImageHeight(), 0, GL_RGB, GL_UNSIGNED_BYTE, mySTGA.getImageData());
THanks lots an lots!!



