
    \
j;k                     $   d Z ddlZddlZddlZddlT ddlmZ ddlmZmZm	Z	 ej
        d         Zd Zd Zd	 Zd
 Zd Zd Z G d d          Z G d d          Z G d de          Z e            Z G d de          Z G d de          ZdS )a<  Low-level graphics rendering.

This module provides an efficient low-level abstraction over OpenGL.  It gives
very good performance for rendering OpenGL primitives; far better than the
typical immediate-mode usage and, on modern graphics cards, better than using
display lists in many cases.  The module is used internally by other areas of
pyglet.

See the :ref:`guide_graphics` for details on how to use this graphics API.

Batches and groups
==================

Without even needing to understand the details on how to draw primitives with
the graphics API, developers can make use of :py:class:`~pyglet.graphics.Batch` and :py:class:`~pyglet.graphics.Group`
objects to improve performance of sprite and text rendering.

The :py:class:`~pyglet.sprite.Sprite`, :py:func:`~pyglet.text.Label` and :py:func:`~pyglet.text.layout.TextLayout` classes all accept a ``batch`` and
``group`` parameter in their constructors.  A batch manages a set of objects
that will be drawn all at once, and a group describes the manner in which an
object is drawn.

The following example creates a batch, adds two sprites to the batch, and then
draws the entire batch::
    
    batch = pyglet.graphics.Batch()
    car = pyglet.sprite.Sprite(car_image, batch=batch)
    boat = pyglet.sprite.Sprite(boat_image, batch=batch)
    
    def on_draw()
        batch.draw()

Drawing a complete batch is much faster than drawing the items in the batch
individually, especially when those items belong to a common group.  

Groups describe the OpenGL state required for an item.  This is for the most
part managed by the sprite and text classes, however you can also use groups
to ensure items are drawn in a particular order.  For example,  the following
example adds a background sprite which is guaranteed to be drawn before the
car and the boat::

    batch = pyglet.graphics.Batch()
    background = pyglet.graphics.OrderedGroup(0)
    foreground = pyglet.graphics.OrderedGroup(1)

    background = pyglet.sprite.Sprite(background_image, 
                                      batch=batch, group=background)
    car = pyglet.sprite.Sprite(car_image, batch=batch, group=foreground)
    boat = pyglet.sprite.Sprite(boat_image, batch=batch, group=foreground)
    
    def on_draw()
        batch.draw()

It's preferable to manage sprites and text objects within as few batches as
possible.  If the drawing of sprites or text objects need to be interleaved
with other drawing that does not use the graphics API, multiple batches will
be required.

Data item parameters
====================

Many of the functions and methods in this module accept any number of ``data``
parameters as their final parameters.  In the documentation these are notated
as ``*data`` in the formal parameter list.

A data parameter describes a vertex attribute format and an optional sequence
to initialise that attribute.  Examples of common attribute formats are:

``"v3f"``
    Vertex position, specified as three floats.
``"c4B"``
    Vertex color, specified as four unsigned bytes.
``"t2f"``
    Texture coordinate, specified as two floats.

See `pyglet.graphics.vertexattribute` for the complete syntax of the vertex
format string.

When no initial data is to be given, the data item is just the format string.
For example, the following creates a 2 element vertex list with position and
color attributes::

    vertex_list = pyglet.graphics.vertex_list(2, 'v2f', 'c4B')

When initial data is required, wrap the format string and the initial data in
a tuple, for example::

    vertex_list = pyglet.graphics.vertex_list(2, 
                                              ('v2f', (0.0, 1.0, 1.0, 0.0)),
                                              ('c4B', (255, 255, 255, 255) * 2))

Drawing modes
=============

Methods in this module that accept a ``mode`` parameter will accept any value
in the OpenGL drawing mode enumeration: ``GL_POINTS``, ``GL_LINE_STRIP``,
``GL_LINE_LOOP``, ``GL_LINES``, ``GL_TRIANGLE_STRIP``, ``GL_TRIANGLE_FAN``,
``GL_TRIANGLES``, ``GL_QUAD_STRIP``, ``GL_QUADS``, and ``GL_POLYGON``.

:: 

    pyglet.graphics.draw(1, GL_POINTS, ('v2i',(10,20)))

However, because of the way the graphics API renders multiple primitives with 
shared state, ``GL_POLYGON``, ``GL_LINE_LOOP`` and ``GL_TRIANGLE_FAN`` cannot
be used --- the results are undefined.

When using ``GL_LINE_STRIP``, ``GL_TRIANGLE_STRIP`` or ``GL_QUAD_STRIP`` care
must be taken to insert degenerate vertices at the beginning and end of each
vertex list.  For example, given the vertex list::

    A, B, C, D

the correct vertex list to provide the vertex list is::

    A, A, B, C, D, D

Alternatively, the ``NV_primitive_restart`` extension can be used if it is
present.  This also permits use of ``GL_POLYGON``, ``GL_LINE_LOOP`` and
``GL_TRIANGLE_FAN``.   Unfortunately the extension is not provided by older
video drivers, and requires indexed vertex lists.

.. versionadded:: 1.1
    N)*)gl)vertexbuffervertexattributevertexdomaindebug_graphics_batchc                    t          t                     g }|D ]\  }}t          j        |          }| t	          |          |j        z  k    sJ d|z              t          j        | |j        z  d          }|	                    |d| |           |
                                 |                    |j                   |                    |           t          |d|            t                       t!                       dS )a_  Draw a primitive immediately.

    :Parameters:
        `size` : int
            Number of vertices given
        `mode` : gl primitive type 
            OpenGL drawing mode, e.g. ``GL_TRIANGLES``, 
            avoiding quotes.
        `data` : data items
            Attribute formats and data.  See the module summary for 
            details.

    Data for %s is incorrect lengthFvbor   N)glPushClientAttribGL_CLIENT_VERTEX_ARRAY_BITr   create_attributelencountr   create_mappable_bufferstride
set_regionenableset_pointerptrappendglDrawArraysglFlushglPopClientAttrib)sizemodedatabuffersfmtarray	attributebuffers           R/DATA/AppData/hermes/venv/lib/python3.11/site-packages/pyglet/graphics/__init__.pydrawr%      s
    1222G  
U#4S99	s5zzY_44446WZ]6]4444TI<L5LRWXXXVQe444fj)))vq$III    c                    t          t                     g }|D ]\  }}t          j        |          }| t	          |          |j        z  k    sJ d|z              t          j        | |j        z  d          }|	                    |d| |           |
                                 |                    |j                   |                    |           | dk    rt          }	t          j        }
n-| dk    rt"          }	t          j        }
nt&          }	t          j        }
 |
t	          |          z  | }t+          |t	          |          |	|           t-                       t/                       dS )a  Draw a primitive with indexed vertices immediately.

    :Parameters:
        `size` : int
            Number of vertices given
        `mode` : int
            OpenGL drawing mode, e.g. ``GL_TRIANGLES``
        `indices` : sequence of int
            Sequence of integers giving indices into the vertex list.
        `data` : data items
            Attribute formats and data.  See the module summary for details.

    r
   Fr   r      i  N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   GL_UNSIGNED_BYTEctypesc_ubyteGL_UNSIGNED_SHORTc_ushortGL_UNSIGNED_INTc_uintglDrawElementsr   r   )r   r   indicesr   r   r    r!   r"   r#   
index_typeindex_c_typeindex_arrays               r$   draw_indexedr5      sc    1222G  
U#4S99	s5zzY_44446WZ]6]4444TI<L5LRWXXXVQe444fj)))vt||%
~	&
$
}.<#g,,.9K4Wz;???IIIr&   c                     | s
J d            g }g }t          |           D ]K\  }}t          |t                    r|\  }}|                    ||f           |                    |           Lt          |          }||fS )z>Given a list of data items, returns (formats, initial_arrays).zNo attribute formats given)	enumerate
isinstancetupler   )r   formatsinitial_arraysir    r!   s         r$   _parse_datar=      s    -----4 GND//  3c5!! 	.JC!!1e*---sGnnGN""r&   c                      t           j        j        } 	 | j        S # t          $ r t                      | _        | j        cY S w xY wN)r   current_contextobject_spacepyglet_graphics_default_batchAttributeErrorBatch)shared_object_spaces    r$   _get_default_batchrF   	  sX    ,9A"@@ A A A<AGG9"@@@@As    $A Ac                 :     t                      j        | ddg|R  S )a  Create a :py:class:`~pyglet.graphics.vertexdomain.VertexList` not associated with a batch, group or mode.

    :Parameters:
        `count` : int
            The number of vertices in the list.
        `data` : data items
            Attribute formats and initial data for the vertex list.  See the
            module summary for details.

    :rtype: :py:class:`~pyglet.graphics.vertexdomain.VertexList`
    r   N)rF   add)r   r   s     r$   vertex_listrI     s*     $#E1d:T::::r&   c                 <     t                      j        | dd|g|R  S )a  Create an `IndexedVertexList` not associated with a batch, group or mode.

    :Parameters:
        `count` : int
            The number of vertices in the list.
        `indices` : sequence
            Sequence of integers giving indices into the vertex list.
        `data` : data items
            Attribute formats and initial data for the vertex list.  See the
            module summary for details.

    :rtype: `IndexedVertexList`
    r   N)rF   add_indexed)r   r1   r   s      r$   vertex_list_indexedrL   #  s,      ,+E1dGKdKKKKr&   c                   T    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd ZdS )rD   a  Manage a collection of vertex lists for batched rendering.

    Vertex lists are added to a :py:class:`~pyglet.graphics.Batch` using the `add` and `add_indexed`
    methods.  An optional group can be specified along with the vertex list,
    which gives the OpenGL state required for its rendering.  Vertex lists
    with shared mode and group are allocated into adjacent areas of memory and
    sent to the graphics card in a single operation.

    Call `VertexList.delete` to remove a vertex list from the batch.
    c                 L    i | _         i | _        g | _        g | _        d| _        dS )zCreate a graphics batch.FN)	group_mapgroup_children
top_groups
_draw_list_draw_list_dirtyselfs    r$   __init__zBatch.__init__B  s3      !  %r&   c                     d| _         dS )zForce the batch to update the draw list.

        This method can be used to force the batch to re-compute the draw list
        when the ordering of groups has changed.

        .. versionadded:: 1.2
        TN)rS   rT   s    r$   
invalidatezBatch.invalidateQ  s     !%r&   c                     t          |          \  }}|                     d|||          }|                    |          }|D ]\  }	}
|                    |	|
           |S )a  Add a vertex list to the batch.

        :Parameters:
            `count` : int
                The number of vertices in the list.
            `mode` : int
                OpenGL drawing mode enumeration; for example, one of
                ``GL_POINTS``, ``GL_LINES``, ``GL_TRIANGLES``, etc.
                See the module summary for additional information.
            `group` : `~pyglet.graphics.Group`
                Group of the vertex list, or ``None`` if no group is required.
            `data` : data items
                Attribute formats and initial data for the vertex list.  See
                the module summary for details.

        :rtype: :py:class:`~pyglet.graphics.vertexdomain.VertexList`
        F)r=   _get_domaincreate_set_attribute_data)rU   r   r   groupr   r:   r;   domainvlistr<   r!   s              r$   rH   z	Batch.add[  ss    $ #.d"3"3!!%ug>> e$$& 	0 	0HAu%%a////r&   c                 .   t          |          \  }}|                     d|||          }|                    |t          |                    }	|	j        |	                    fd|D                        |D ]\  }
}|	                    |
|           |	S )a%  Add an indexed vertex list to the batch.

        :Parameters:
            `count` : int
                The number of vertices in the list.
            `mode` : int
                OpenGL drawing mode enumeration; for example, one of
                ``GL_POINTS``, ``GL_LINES``, ``GL_TRIANGLES``, etc.
                See the module summary for additional information.
            `group` : `~pyglet.graphics.Group`
                Group of the vertex list, or ``None`` if no group is required.
            `indices` : sequence
                Sequence of integers giving indices into the vertex list.
            `data` : data items
                Attribute formats and initial data for the vertex list.  See
                the module summary for details.

        :rtype: `IndexedVertexList`
        Tc                     g | ]}|z   S  rb   ).0r<   starts     r$   
<listcomp>z%Batch.add_indexed.<locals>.<listcomp>  s    :::Qq5y:::r&   )r=   rZ   r[   r   rd   _set_index_datar\   )rU   r   r   r]   r1   r   r:   r;   r^   r_   r<   r!   rd   s               @r$   rK   zBatch.add_indexedw  s    ( #.d"3"3!!$eW== eS\\22::::':::;;;& 	0 	0HAu%%a////r&   c                     |j         j        }t          |t          j                  r|                    d|||          }n|                    d|||          }|                    |           dS )a  Migrate a vertex list to another batch and/or group.

        `vertex_list` and `mode` together identify the vertex list to migrate.
        `group` and `batch` are new owners of the vertex list after migration.  

        The results are undefined if `mode` is not correct or if `vertex_list`
        does not belong to this batch (they are not checked and will not
        necessarily throw an exception immediately).

        `batch` can remain unchanged if only a group change is desired.
        
        :Parameters:
            `vertex_list` : `~pyglet.graphics.vertexdomain.VertexList`
                A vertex list currently belonging to this batch.
            `mode` : int
                The current GL drawing mode of the vertex list.
            `group` : `~pyglet.graphics.Group`
                The new group to migrate to.
            `batch` : `~pyglet.graphics.Batch`
                The batch to migrate to (or the current batch).

        TFN)r^   _Batch__formatsr8   r   IndexedVertexListrZ   migrate)rU   rI   r   r]   batchr:   r^   s          r$   rj   zBatch.migrate  ss    . $.k<#ABB 	D&&tT5'BBFF&&udE7CCFF#####r&   c                    |t           }|| j        vr|                     |           | j        |         }|||f}	 ||         }nB# t          $ r5 |rt	          j        | }nt	          j        | }||_        |||<   d| _        Y nw xY w|S NT)	
null_grouprO   
_add_groupKeyErrorr   create_indexed_domaincreate_domainrh   rS   )rU   indexedr   r]   r:   
domain_mapkeyr^   s           r$   rZ   zBatch._get_domain  s    =E &&OOE"""^E*
 g&
	)_FF 	) 	) 	) >%;WE%3W=&F$JsO$(D!!!	) s   A <BBc                 t   i | j         |<   |j        | j                            |           nj|j        | j         vr|                     |j                   |j        | j        vrg | j        |j        <   | j        |j                                     |           |j                            |            d| _        d S rm   )	rO   parentrQ   r   ro   rP   _assigned_batchesrH   rS   )rU   r]   s     r$   ro   zBatch._add_group  s     "u<O""5))))|4>11---|4#66646#EL1-44U;;;##D))) $r&   c                       fdg  _          j                                         t           j                  D ],}|j        r# j                              |                     -d _        t          r                                  dS dS )zYVisit group tree in preorder and create a list of bound methods
        to call.
        c                    g }	j         |          }t          |                                          D ]D\  \  }}}}|                                r||||f= $|                     d ||                     E	j                            |           }|rK|                                 t          |          D ]'}|j        r|	                     
|                     (|s|r| j
        g|z   | j        gz   S 	j         | = | j                            	           | j        r%	j        | j                                     |            	 	j        | = n# t          $ r Y nw xY w	 	j                            |            n# t"          $ r Y nw xY wg S )Nc                       fdS )Nc                  .                                    S r?   )r%   dms   r$   <lambda>zJBatch._update_draw_list.<locals>.visit.<locals>.<lambda>.<locals>.<lambda>  s    !&&)) r&   rb   r}   s   ``r$   r   z8Batch._update_draw_list.<locals>.visit.<locals>.<lambda>  s    "3"3"3"3"3 r&   )rO   listitems	_is_emptyr   rP   getsortvisibleextend	set_stateunset_staterx   removerw   rp   rQ   
ValueError)r]   	draw_listrt   r:   r   rs   r^   childrenchildrU   visits            r$   r   z&Batch._update_draw_list.<locals>.visit  s   I .J489I9I9K9K4L4L D D0($&##%% "GT7#;<  333VTBBD D D D *..u55H 7!(^^ 7 7E} 7!((u666 : (948I7JJJ N5)'..t444< D'5<<UCCC+E22   DO**51111!   D 	s$   E 
EEE: :
FFFN)	rR   rQ   r   r   r   r   rS   _debug_graphics_batch_dump_draw_list)rU   r]   r   s   ` @r$   _update_draw_listzBatch._update_draw_list  s    
&	 &	 &	 &	 &	 &	P $/** 	5 	5E} 5&&uuU||444 %  	#  """""	# 	#r&   c                 f     d fd	t          d z              j        D ]} |           d S )N c           	         t          |d|            j        |          }|                                D ]\  }}t          |d|           t          |j                                         D ]\  }}t          |dd||fz             |j                                        D ]h\  }}t          |dd           	 |                    |j        ||          }	t          ||	j	        d d                     R#  t          |d           Y fxY wՉj
                            | d	          D ]}
 |
|dz              t          |d
|            d S )NzBegin groupz  z    zRegion %d size %d:z       )endz(unmappable)rb   z	End group)printrO   r   zip	allocatorget_allocated_regionsattribute_names
get_regionr#   r!   rP   r   )r]   indentrt   _r^   rd   r   ru   r"   regionr   dumprU   s              r$   r   z#Batch._dump_draw_list.<locals>.dump  s   &-///.J'--// 
7 
7	6fdF+++#&(8(N(N(P(P#Q 7 7KE4&&*>%*NOOO*0*@*F*F*H*H 7 7YfhC88887%.%9%9):JESW%X%XF!#v|AAA77777!#~6666677 ,00;; + +UFTM****&+u-----s   69C00D	zDraw list for %r:)r   )r   rQ   )rU   r]   r   s   ` @r$   r   zBatch._dump_draw_list  sg    	. 	. 	. 	. 	. 	. 	.$ 	!D()))_ 	 	EDKKKK	 	r&   c                 d    | j         r|                                  | j        D ]} |             dS )zDraw the batch.
        N)rS   r   rR   )rU   funcs     r$   r%   z
Batch.draw-  sI       	%""$$$O 	 	DDFFFF	 	r&   c                       fd j                                           j         D ]}|j        r |           dS )a  Draw only some vertex lists in the batch.

        The use of this method is highly discouraged, as it is quite
        inefficient.  Usually an application can be redesigned so that batches
        can always be drawn in their entirety, using `draw`.

        The given vertex lists must belong to this batch; behaviour is
        undefined if this condition is not met.

        :Parameters:
            `vertex_lists` : sequence of `VertexList` or `IndexedVertexList`
                Vertex lists to draw.

        c                    |                                   j        |          }|                                D ],\  \  }}}}	D ] }|j        |u r|                    |           !-j                            |           }|r+|                                 |D ]}|j        r 
|           | 	                                 d S r?   )
r   rO   r   r^   r%   rP   r   r   r   r   )r]   rt   r   r   r^   alistr   r   rU   vertex_listsr   s           r$   r   z Batch.draw_subset.<locals>.visitG  s    OO .J(2(8(8(:(: ) )$D!f) ) )E|v--

4((()
 *..u55H %% % %E} %er&   N)rQ   r   r   )rU   r   r]   r   s   `` @r$   draw_subsetzBatch.draw_subset6  sq    "	  	  	  	  	  	  	 ( 	_ 	 	E} e	 	r&   N)__name__
__module____qualname____doc__rV   rX   rH   rK   rj   rZ   ro   r   r   r%   r   rb   r&   r$   rD   rD   6  s        	 	& & &% % %  8  @$ $ $<  4% % %7# 7# 7#r  .  ( ( ( ( (r&   rD   c                       e Zd ZdZddZed             Zej        d             Zed             Zd Z	d Z
d	 Zd
 Zd ZdS )Groupa8  Group of common OpenGL state.

    Before a vertex list is rendered, its group's OpenGL state is set; as are
    that state's ancestors' states.  This can be defined arbitrarily on
    subclasses; the default state change has no effect, and groups vertex
    lists only in the order in which they are drawn.
    Nc                 R    || _         d| _        t          j                    | _        dS )a  Create a group.

        :Parameters:
            `parent` : `~pyglet.graphics.Group`
                Group to contain this group; its state will be set before this
                state's.
            `visible` : bool
                Determines whether this group is visible in any of the batches it is assigned to.
            `batches` : list
                Read Only. A list of which batches this group is a part of. 
        TN)rw   _visibleweakrefWeakSetrx   )rU   rw   s     r$   rV   zGroup.__init__j  s(     !(!2!2r&   c                     | j         S r?   )r   rT   s    r$   r   zGroup.visiblez  s
    }r&   c                 P    || _         | j        D ]}|                                 d S r?   )r   rx   rX   )rU   valuerk   s      r$   r   zGroup.visible~  s:    + 	 	E	 	r&   c                 $    d | j         D             S )Nc                     g | ]}|S rb   rb   )rc   rk   s     r$   re   z!Group.batches.<locals>.<listcomp>  s    :::%:::r&   )rx   rT   s    r$   batcheszGroup.batches  s    ::4#9::::r&   c                 B    t          |           t          |          k     S r?   )hashrU   others     r$   __lt__zGroup.__lt__  s    DzzDKK''r&   c                     dS )zZApply the OpenGL state change.  
        
        The default implementation does nothing.Nrb   rT   s    r$   r   zGroup.set_state  	     	r&   c                     dS )zYRepeal the OpenGL state change.
        
        The default implementation does nothing.Nrb   rT   s    r$   r   zGroup.unset_state  r   r&   c                 n    | j         r| j                                          |                                  dS )zSet this group and its ancestry.

        Call this method if you are using a group in isolation: the
        parent groups will be called in top-down order, with this class's
        `set` being called last.
        N)rw   set_state_recursiver   rT   s    r$   r   zGroup.set_state_recursive  s8     ; 	.K++---r&   c                 r    |                                   | j        r| j                                         dS dS )zZUnset this group and its ancestry.

        The inverse of `set_state_recursive`.
        N)r   rw   unset_state_recursiverT   s    r$   r   zGroup.unset_state_recursive  sD    
 	; 	0K--/////	0 	0r&   r?   )r   r   r   r   rV   propertyr   setterr   r   r   r   r   r   rb   r&   r$   r   r   a  s         3 3 3 3    X ^  ^ ; ; X;( ( (    	 	 	0 0 0 0 0r&   r   c                       e Zd ZdZdS )	NullGroupzlThe default group class used when ``None`` is given to a batch.

    This implementation has no effect.
    N)r   r   r   r   rb   r&   r$   r   r     s          	Dr&   r   c                   B     e Zd ZdZd	 fd	Zd Zd Zd Zd Zd Z	 xZ
S )
TextureGroupz|A group that enables and binds a texture.

    Texture groups are equal if their textures' targets and names are equal.
    Nc                 f    t          t          |                               |           || _        dS )zCreate a texture group.

        :Parameters:
            `texture` : `~pyglet.image.Texture`
                Texture to bind.
            `parent` : `~pyglet.graphics.Group`
                Parent group.

        N)superr   rV   texture)rU   r   rw   	__class__s      r$   rV   zTextureGroup.__init__  s.     	lD!!**6222r&   c                     t          | j        j                   t          | j        j        | j        j                   d S r?   )glEnabler   targetglBindTextureidrT   s    r$   r   zTextureGroup.set_state  s4    $%%%dl)4<?;;;;;r&   c                 8    t          | j        j                   d S r?   )	glDisabler   r   rT   s    r$   r   zTextureGroup.unset_state  s    $,%&&&&&r&   c                 X    t          | j        j        | j        j        | j        f          S r?   )r   r   r   r   rw   rT   s    r$   __hash__zTextureGroup.__hash__  s"    T\($,/4;GHHHr&   c                     | j         |j         u oC| j        j        |j        j        k    o)| j        j        |j        j        k    o| j        |j        k    S r?   )r   r   r   r   rw   r   s     r$   __eq__zTextureGroup.__eq__  sS    %/1 ,#u}';;,5=#33, u|+	-r&   c                 8    d| j         j        | j        j        fz  S )Nz	%s(id=%d))r   r   r   r   rT   s    r$   __repr__zTextureGroup.__repr__  s    dn5t|GGGr&   r?   )r   r   r   r   rV   r   r   r   r   r   __classcell__r   s   @r$   r   r     s              < < <' ' 'I I I- - -H H H H H H Hr&   r   c                   @     e Zd ZdZd fd	Z fdZd Zd Zd Z xZ	S )	OrderedGroupzA group with partial order.

    Ordered groups with a common parent are rendered in ascending order of
    their ``order`` field.  This is a useful way to render multiple layers of
    a scene within a single batch.
    Nc                 f    t          t          |                               |           || _        dS )zCreate an ordered group.

        :Parameters:
            `order` : int
                Order of this group.
            `parent` : `~pyglet.graphics.Group`
                Parent of this group.

        N)r   r   rV   order)rU   r   rw   r   s      r$   rV   zOrderedGroup.__init__  s.     	lD!!**6222


r&   c                     t          |t                    r| j        |j        k     S t          t          |                               |          S r?   )r8   r   r   r   r   )rU   r   r   s     r$   r   zOrderedGroup.__lt__  sB    e\** 	,:++\4((//666r&   c                 ^    | j         |j         u o| j        |j        k    o| j        |j        k    S r?   )r   r   rw   r   s     r$   r   zOrderedGroup.__eq__  s5    %/1 ,
ek),u|+	-r&   c                 8    t          | j        | j        f          S r?   )r   r   rw   rT   s    r$   r   zOrderedGroup.__hash__	  s    TZ-...r&   c                 .    d| j         j        | j        fz  S )Nz%s(%d))r   r   r   rT   s    r$   r   zOrderedGroup.__repr__  s    4>2DJ???r&   r?   )
r   r   r   r   rV   r   r   r   r   r   r   s   @r$   r   r     s              7 7 7 7 7
- - -
/ / /@ @ @ @ @ @ @r&   r   )r   r*   r   pyglet	pyglet.glr   pyglet.graphicsr   r   r   optionsr   r%   r5   r=   rF   rI   rL   rD   r   r   rn   r   r   rb   r&   r$   <module>r      s  H{ {z              G G G G G G G G G G'=>   B) ) )X# # # A A A; ; ;"L L L&h h h h h h h hV	I0 I0 I0 I0 I0 I0 I0 I0X	 	 	 	 	 	 	 	 Y[[
&H &H &H &H &H5 &H &H &HR)@ )@ )@ )@ )@5 )@ )@ )@ )@ )@r&   