glTexImage3D crashing

Not sure why but my program crashes when I try to use the glTexImage3D function.

 //Load the volume texture into the gfx card
    glTexImage3D(GL_TEXTURE_3D,
		 0,
		 GL_RGBA,
		 getWidth(),
		 getHeight(),
		 getDepth(),
		 0,
		 GL_RGBA,
		 GL_UNSIGNED_BYTE,
		 mv_pGradientNScalar);  

When it gets to hear it gives me a memory violation error. (mv_pGradietnNScalar is manually generated with 4 components)

This is running on ATI X700, any ideas?

What are the dimensions of the texture? And how much memory does the ATI X700 have? And how much physical memory and swap/virual memory do you have?

Hi,

the texture is fairly small, 64x64x8
the x700 is 256MB and 1G of RAM in the system.

I dont think i’m going over my memory limits here but any ideas greatly appreciated

The memory violation error is most likely due to the mv_pGradietnNScalar array being too small. The driver tried to read it past the end.

How do you create/malloc it ? what values are returned by getWidth(),
getHeight(),
getDepth(), ?

Fixed the problem now, thx for the help, it turns out that it wasnt linking properly to the functions so doing it manually fixed it.

i.e…

glTexImage3D=(PFNGLTEXIMAGE3DEXTPROC)wglGetProcAddress("glTexImage3D");  

Use glew
it will get all the function pointers for you and it’s up to date.

glew.sourceforge.com