Hi Josh,

There is a typo with the vertex color type. It looks like you want to use 
8bit values, so If you change *c4b* to *c4B* it should work.

By the way, is there a specific reason you're using Domains directly, 
instead of just creating a Batch? There is nothing wrong with your 
approach, but using a Batch might save a bit of boilerplate.

-Ben

On Thursday, August 23, 2018 at 3:13:34 AM UTC+9, Josh wrote:
>
> Hi all,
>
> I have what (I thought) is a MWE for drawing primitives with a 
> VertexDomain:
> import pyglet
> from pyglet.gl import *
>
> if __name__ == '__main__':
>
>     display = pyglet.window.Window(400, 400)
>
>
>     domain = pyglet.graphics.vertexdomain.create_domain('v2i/stream', 
> 'c4b/stream')
>     vertex_list = domain.create(4)
>     vertex_list.vertices = [50, 50, 50, 100, 100, 100, 100, 50]
>     vertex_list.colors = [
>                         255, 255, 255, 255,
>                         255, 0, 0, 255,
>                         0, 255, 0, 255, 
>                         0, 0, 255, 255
>     ]
>
>     @display.event
>     def on_draw():
>         display.clear()
>         pyglet.graphics.draw(1, GL_POINTS, ('v2i',(10,20)))
>         domain.draw(GL_POINTS)
>                 
>     pyglet.app.run()
>
> However, while the single pixel drawn directly by 
> pyglet.graphics.drawshows up, the points from the vertex domain don't. What 
> am I missing?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyglet-users+unsubscr...@googlegroups.com.
To post to this group, send email to pyglet-users@googlegroups.com.
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to