To use it, you instantiate your vertex list the normal way except you can specify multiple sets of texture coordinates. Then you call multitexture.enable() passing it your new vertex list. Here's a simple example:
vl = pyglet.graphics.vertex_list(4,
('v2f', (100, 100, 200, 100, 200, 200, 100, 200)),
('t2f', (0, 0, 1, 0, 1, 1, 0, 1)),
('t2f', (0, 0, 0.25, 0, 0.25, 0.25, 0, 0.25)),
)
multitexture.enable(vl)
You can get the module here.
You may be interested to know that pyglet 1.2 (in trunk) has support for multi-texture coordinates. e.g., use ``3t2f` for a 2-float texture coordinate for texture unit 3.
ReplyDeleteGood to know. I should definitely take a look at what's cooking in 1.2
ReplyDelete