From: Peter <kaf...@xt...> - 2002-10-31 19:52:47
|
> On Wednesday 30 October 2002 20:08, Peter wrote: > > > > One definite difference between my code and JCanyon is that I'm not > > > > using the NIO direct buffers, though OTOH I'm using display lists, > > > > so > > > > > > that shouldn't matter beyond the initial access. > > > > > > no, that is not correct. Java can move your vertex/normal/whatever > > > > arrays > > > > > around underneath you before your get the chance to call > > > > glArrayElement > > > > > (or > > > similar). > > > > As I said in my post, I'm using *Display Lists*. It doesn't matter what > > happens to the arrays after the lists are made (altering the arrays has > > no effect on the data stored in the list whatsoever) > > > > Your arrays can be moved around *before* you create the display list, and > after you specify the array. To create a display list your would do > something > like this: > > float[] vertex_array; > int[] indices; > > ... > > glVertexPointer(..., vertex_array); > > ... <- It it here, between the array call, and the draw call that your > vertex > data arrays can move around. > > glDrawElements(...., indices); > > And yes, that gap between glVertexPointer and glDrawElements is normally > very > small, but believe me, it can happen. > Oh, ok - I see your point. Sorry - I misunderstood what you were getting at. ;-) Thanks for the feedback. Peter. |