I think my way of accessing the texture id worked ok (sprite.image.texture.id instead of sprite._texture.id) , but the rest is way over my head. Thanks again for your help and pointers, I'll have a look at all this stuff
Le mardi 12 novembre 2013 23:39:01 UTC+1, Claudio Canepa a écrit : > > > > > On Tue, Nov 12, 2013 at 6:21 PM, Nitneroc <[email protected]<javascript:> > > wrote: > >> Ok, this is much much more work than I thought... OpenGL and shaders are >> far from easy (for me at least), and are a new world to explore. >> >> I took a look at your code (thanks again) and tried to make it work over >> sprites. It seemed to work ok, and I decided to make it change the texture >> of my sprite. I thought it would be easy and just changed >> self.usetTex('tex', >> 0, GL_TEXTURE_2D, provider.image.texture.id) to self.usetTex('tex', 0, >> GL_TEXTURE_2D, over_sprite.image.texture.id)... But this generates an >> error : "pyglet.gl.lib.GLException: invalid operation". It's the >> BindTexture() from usetTex() that crashes. >> >> Do you have any hint ?.. >> >> > assuming over_sprite is a sprite, the associated texture lives in > over_sprite._texture > > > >> I guess this is just too hard for me at the moment, I should probably >> stick to the color attribute >> > > Reading the code in pyglet.sprite may help you understand batches, also, > as I mentioned in other thread > > in pyglet programing guide > http://www.pyglet.org/doc/programming_guide/batched_rendering.html > > introduction to batches, see slides and code in > http://tartley.com/?p=378 > -- You received this message because you are subscribed to the Google Groups "cocos2d discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/cocos-discuss. For more options, visit https://groups.google.com/groups/opt_out.
