On Wed, Feb 17, 2010 at 9:55 AM, flaviusxvii <[email protected]> wrote:

> On Feb 16, 7:09 pm, Tristam MacDonald <[email protected]> wrote:
>
> > @flaviusxvii Your OpenGL code looks fine to me. Are you sure the error is
> in
> > this part of your code?
> >
>
> This code WAS running ok for a while, but I was concerned about how
> I'm passing in the offset values for glVertexPointer (the last
> argument). Because in my c++ code i have to give the right offsets
> based on bytes, and doing things like that always confuses me in
> python because I always feel like I shouldn't be concerned with bytes
> and whatnot.
>

OpenGL deals with bytes, so yes, you pass in integer numbers of bytes.


> And then my second question was whether or not my data format can be
> used with the pyglet vertex_array stuff, because then it would handle
> this stuff for me I think.
>

Pyglet doesn't offer a thin wrapper around vertex buffer objects, so I am
afraid it is either roll your own (I do this for most pyglet work), or
reformat your data into pyglet's preference.


On Wed, Feb 17, 2010 at 4:36 AM, Florian Bösch <[email protected]> wrote:

> I one of the issues I have with pyglets VBOs is that their buildup
> performance is abysmal. That is because it copies the data as
> iterables out of what you pass in. You could get great buildup
> performance benefits by testing if the data that's passed in is
> conforming to the expected ctypes type you're coping it into, and
> doing a memmove instead of passing an iterable to a ctypes constructor.


This would be a very worthwhile optimisation. It would also be useful to be
able to write to vertex buffers after the fact (as ctypes data), and have
pyglet map the vertex buffer object as needed.

-- 
Tristam MacDonald
http://swiftcoder.wordpress.com/

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to