On Feb 27, 6:38 pm, Tristam MacDonald <[email protected]> wrote:
> The shader class is pulled from my current game project 
> (http://darkcoda.googlecode.com). You can find a much newer version in the
> SVN there, which caches attribute locations, among other things - although
> the source is not as clean. The project also contains a rudimentary renderer
> built on top of pyglet, but it isn't particularly user friendly at this
> stage.

The attribute location caching is nice. Though you should get
GL_CURRENT_PROGRAM and save it to be able to restore it upon leaving
that context. Maybe you should glValidateProgram after you've linked
and you should check that 'GL_ARB_fragment_program' and
'GL_ARB_vertex_program' are available as extensions before using them,
and sometimes you'd like not to attach a fragment or vertex shader
program. Sometimes it might be desirable to attach multiple Fragment/
Vertex programs, which is why you should maybe split the objects up in
classes that can be passed to the program object.
--~--~---------~--~----~------------~-------~--~----~
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