patrickm's picture

Attempting to do texturing, getting an accessviolationexception

Hi again All,

I'm trying to get texturing to work now, and having some trouble with it, I get an accessviolationexception on my drawelements call. The project is here, I was hoping someone could take a look.

Patrick


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
patrickm's picture

I'm pretty sure it has something to do with the way I'm setting up GL.InterleavedArrays, or my vertex structure, I'm just not sure how exactly to diagnose this issue. I tried the debug version of the library and didn't really get any more information.

patrickm's picture

Ok, I've got it working, but it just displays a black cube now. All I changed was the line:

GL.InterleavedArrays(InterleavedArrayFormat.T2fN3fV3f, 0, IntPtr.Zero);

in mesh.bindvertexbuffers, to:

GL.VertexAttribPointer(0, 2, VertexAttribPointerType.Float, false, 32, 0);
GL.VertexAttribPointer(1, 3, VertexAttribPointerType.Float, true, 32, 8);
GL.VertexAttribPointer(2, 3, VertexAttribPointerType.Float, false, 32, 20);

Black cube is better than error message, but I'm not sure what is still wrong...