glTexSubImage3DExt Problem


I am implementing an eraser tool on a 512512512 bytes 3d texture

Here is my code:

eraser_texture : ^byte;

Zeromemory(eraser_texture, 505050);

glTexSubImage3DExt (GL_TEXTURE_3D, 0, 200, 200, 0,50, 50, 50, GL_Luminance, GL_UNSIGNED_BYTE, eraser_texture);

Unfortunately, the glTexSubImage3DExt function gives an access violation. Although this is not a solution, when I doubled the size of the eraser_texture pointer, the function worked fine. What am I missing?? :confused:

This is an extension, so you’ll need to load it with wglGetProcAddressARB. I don’t know if you can simply use glTexSubImage3D instead. Also, depending on the version this extension had been released and the version of your gl, you can access it, using the define GL_GLEXT_PROTOTYPES.

Hope that helps.