Ricardo.Bueno's picture

GL.DrawElements() crashs when using a big array.

Hello, folks.
I`m developing an application that draws a ruge triangulated points cloud using OpenTK.

Take a look at this code:

...
GL.DrawElements( BeginMode.Triangles, triangles.Count, DrawElementsType.UnsignedInt, triangles.ToArray() );
...

When the execution reaches this line, my program crashes and tells me that vshost.exe stopped to work.

Details of the call:

triangles.Count = 9.999.999
triangles.ToArray() return a reference, because is a customized List, so it does not return a copy, like the default c# List.

My environment:

Windows 7 64 bits
Visual Studio 2010 Express

Does anyone knows if exists some limits of memory usage on DrawElements()?
Maybe OpenTK has the 32bit memory limit?!

Thanks

Ricardo Bueno
CharPointer


Comments

Comment viewing options

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

The example here is for DrawArrays, but it's the same problem as with your DrawElements.

http://www.opentk.com/node/296

And the solution (VBO) is the same aswell.