PDA

View Full Version : Overflow



c0d3Junk3Y
08-09-2003, 04:36 AM
I get a compile warning overflow in Constant expression.

<QUOTE>BYTE Texture[] = {BMP1, BMP2, BMP3};</QUOTE>

This is based on NeHe 's tut #38.

Using LCC Win32 Builder.

The displayed textures are wrong. Only one texture is bieng loaded, and I feel it is from this Warning.

nexusone
08-09-2003, 05:48 AM
Would have to see more of you code, but from what I remember of your last thread you posted I am thinking you still don't understand how texture loading works in openGL.

If you are using the texture variable like in nehe's code then it should be like this:

BYTE Texture[3]; // Space for 3 texture names, remeber openGL asigns these names.

The byte overflow is I am guessing due to you trying to asign something other then a larger then a byte. maybe your BMP? values are not correct.

// Here is how to store file names for loading textures.
char *textureList[] = {"texture1.bmp","texture2.bmp","texture3.bmp"};


then in your loading routine, would look something like this:

for(i=0; i<3; i++)
{
LoadBMP(textureList[i]);
}



Originally posted by c0d3Junk3Y:
I get a compile warning overflow in Constant expression.

<QUOTE>BYTE Texture[] = {BMP1, BMP2, BMP3};</QUOTE>

This is based on NeHe 's tut #38.

Using LCC Win32 Builder.

The displayed textures are wrong. Only one texture is bieng loaded, and I feel it is from this Warning.



[This message has been edited by nexusone (edited 08-09-2003).]