hello again!

on my long travel to deeper pyglet knowledge i now tried to do as you
guys said and now use batches without creating sprites but by just
adding vertex and texture data to my batch.
here you can see my current demo code that oulines how i understand it
up to now: http://phpfi.com/352024

please correct me where I'm wrong but let me just shortly explain what
my understanding is about what the code does up to now:
upon creating the window my tile resource is loaded (despite the pcx
extension this is a png image). the resource module automagically adds
this to a TextureBin which manages a series of TextureAtlas'es which
itself stores images in one big texture. The resource will return a
TextureRegion that describes the placement of my image in this
TextureAtlas so i can access it in there.
next i set some lists and fill them once - this will be done later in
a loop to add more than one tile.
the vertex_data contains the coordinates of each square's corners on
the screen as four x/y coordinates.
the texture data stores the texture coordinates of my image in the
TextureAtlas.
the color_data stores the color of each of my tile's corner. this will
probably be overwritten by my texture.
then i add those four "corners" of my tile with their respective
coordinates and colors to the batch as a GL_QUAD.
the batch is then drawn in the on_draw() method

unfortunately my texture will not show up so a hint on what i'm still
doing wrong is very much appreciated.

thanks again for all your tips and help! i hope I'm a good student and
no bother here :)

cheers

josch

On Sep 9, 10:33 pm, stampson <[EMAIL PROTECTED]> wrote:
> I would start by getting an understanding of how pyglet uses vertex
> lists, vertex attributes, groups, batches, etc, and the documentation
> on setting opengl state per group.  That won't be wasted knowledge, no
> matter what you end up doing with pyglet.  In my own experience,
> getting pyglet to perform is a matter of understanding these things.
> When you know how to do everything in a batch and have it all come out
> in the right order, with minimal state changes, then you'll be flying.
>
> I basically just wrote tons of little demo apps that made pyglet do
> things with sprites, windows, etc and followed my nose wherever was
> interesting.  Then I picked a few challenges, like translating C/C++
> demos to pyglet, and then bigger ones like a quake3 map renderer and
> little physics toys.
>
> Now I'm working on my first 'real' project.  I ended up pulling an
> idea off the shelf which I wasn't even considering for pyglet when I
> started, but after all the exploration I see how it can work.  And
> I'll have it done faster with pyglet than anything else I know.  My
> wife actually commented that she thought I'd been playing a game all
> day, but I was coding with pyglet =)
>
> -price
--~--~---------~--~----~------------~-------~--~----~
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