Yes, although I'm not sure what you mean exactly by "graphics elements". Typically I try to divide duties so that I can test things like positioning separately from the drawing itself.
Testing the positioning is just standard unit testing then (they're just objects with attributes like anything else). Testing the drawing just involves passing in a minimal "mock" gl (as in pyglet.gl) and then asserting that the correct drawing commands were executed. I don't typically do this for specific games, but really just for game engine type stuff which is highly generalized. Also why would resizing the window change an elements coordinates? I would think resizing the window would just change the projection or the viewport size. But maybe I'm missing something. -Casey On Fri, Apr 1, 2011 at 7:40 AM, greenmoss <[email protected]> wrote: > All, > > Does anyone here use unit tests for your graphics elements? For > example, I would like to test "resize the window, and ensure that > element foo has coordinates x,y". Is this possible? > > Thanks > > -- > 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. > > -- 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.
