PDA

View Full Version : glTexImage3D crashing



Nithos
03-17-2005, 12:00 PM
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?

shinpaughp
03-17-2005, 01:55 PM
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?

Nithos
03-18-2005, 07:36 AM
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

03-18-2005, 07:57 AM
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(), ?

Nithos
03-18-2005, 09:59 AM
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)wglGetProcAdd ress("glTexImage3D");

03-19-2005, 04:23 AM
Use glew
it will get all the function pointers for you and it's up to date.

glew.sourceforge.com