Advertisement

texture hassles...

Started by October 25, 2000 10:10 PM
5 comments, last by mrbastard 24 years ago
Hi all, I''m having hassles with textures. Help please! Every so often one of my textures will appear pure white. I''m fairly certain this is down to a loop I''m using for initialising variables overrunning into the texture''s memory space (this was the cause of the prob on another occaision). First off, does anyone know if my diagnosis is correct? Is there anything else that can cause the same prob? (cos I''m damned if I can find the overrun this time!) Second, if this is the cause, can anyone recommmend a quick way of finding the overrun using visual c++ / debugger ? (other than the obvious trawling thru every single line of code with a loop in) Is there any way to find which vars are next to which in memory? Thanks in advance, Dan (mrbastard)
[size="1"]
quote: Original post by mrbastard

Hi all, I''m having hassles with textures. Help please!

Every so often one of my textures will appear pure white. I''m fairly certain this is down to a loop I''m using for initialising variables overrunning into the texture''s memory space (this was the cause of the prob on another occaision).

First off, does anyone know if my diagnosis is correct? Is there anything else that can cause the same prob? (cos I''m damned if I can find the overrun this time!)

Second, if this is the cause, can anyone recommmend a quick way of finding the overrun using visual c++ / debugger ? (other than the obvious trawling thru every single line of code with a loop in)

Is there any way to find which vars are next to which in memory?

Thanks in advance,
Dan (mrbastard)


You''re not a programmer until that moment you stop yourself from destroying your computer into a billion- million pieces
Advertisement
quote: Original post by mrbastard

Hi all, I''m having hassles with textures. Help please!

Every so often one of my textures will appear pure white. I''m fairly certain this is down to a loop I''m using for initialising variables overrunning into the texture''s memory space (this was the cause of the prob on another occaision).

First off, does anyone know if my diagnosis is correct? Is there anything else that can cause the same prob? (cos I''m damned if I can find the overrun this time!)

Second, if this is the cause, can anyone recommmend a quick way of finding the overrun using visual c++ / debugger ? (other than the obvious trawling thru every single line of code with a loop in)

Is there any way to find which vars are next to which in memory?

Thanks in advance,
Dan (mrbastard)


You''re not a programmer until that moment you stop yourself from destroying your computer into a billion- million pieces
Make sure that all your textures have sizes that are powers of 2: 64*64, 128*128, etc.

Martin
______________Martin EstevaolpSoftware
Sorry about the two other replies -- I''m new at this,
Pure white means that you did not enable textures or you didn''t load the .BMP file for the texture.

I don''t see how it could be an overun of memory space?
You''re not a programmer until that moment you stop yourself from destroying your computer into a billion- million pieces
quote: Original post by BloodSweatAndCode

Sorry about the two other replies -- I''m new at this,
Pure white means that you did not enable textures or you didn''t load the .BMP file for the texture.

I don''t see how it could be an overun of memory space?


The reason I think its an overrun is that when it happened before I went thru all my code looking for errors. Then only one I found was a loop I used to initialise a array over running. I made the loop correct and the texture worked. NOTE: the loop / array had NOTHING to do with the textures. Needless to say this freaked me out for a bit, until I decided on the overrun diagnosis.

I did enable textures as the other texture in the prog draws fine (at the same time).

If the BMP failed to load I would have got an error message (I''m using NeHe''s texture loading code)

[size="1"]
Advertisement
I''ve got it! Thanks guys!

The texture was 24x24 (never assume that maths/code you did at 4AM is correct!)

STUPID MISTAKE on my part.

This also (maybe) explains how the overrun caused a similar prob in the first case (the one that led me to the overrun diagnosis). If it overran into the first (64x64) texture''s mem space and set some of it to values OpenGL didn''t recognize as part of the texture, it would mean that as far as OGL was concerned the texture was the wrong size. Sound likely?

Anyways Cheers guys

Dan (mrbastard)
[size="1"]

This topic is closed to new replies.

Advertisement