
    ^jr                       d Z ddlmZ ddlZddlZddlZddlZddlmZm	Z	 ddl
mZmZ ddlZer:ddl
mZ ddlmZ ddlmZ dd	lmZmZmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlm Z   G d de!          Z" G d de!          Z#d%dZ$d&dZ%d&dZ& G d d          Z' G d de'          Z( G d de'          Z) G d d e'          Z* G d! d"          Z+g a, G d# d$e+          Z- e-            Z.e.j/        Z/e.j0        Z0e.j1        Z1e.j2        Z2e.j3        Z3e.j4        Z4e.j5        Z5e.j6        Z6e.j7        Z7e.j8        Z8e.j9        Z9e.j:        Z:e.j;        Z;e.j<        Z<e.j=        Z=e.j>        Z>e.j?        Z?dS )'ap  Load application resources from a known path.

Loading resources by specifying relative paths to filenames is often
problematic in Python, as the working directory is not necessarily the same
directory as the application's script files.

This module allows applications to specify a search path for resources.
Relative paths are taken to be relative to the application's ``__main__``
module. ZIP files can appear on the path; they will be searched inside.  The
resource module also behaves as expected when applications are bundled using
Freezers such as PyInstaller, Nuitka, py2app, etc..

In addition to providing file references (with the :py:func:`file` function),
the resource module also contains convenience functions for loading images,
textures, fonts, media and documents.

3rd party modules or packages not bound to a specific application should
construct their own :py:class:`Loader` instance and override the path to use the
resources in the module's directory.

Path format
^^^^^^^^^^^

The resource path :py:attr:`path` (see also :py:meth:`Loader.__init__` and
:py:meth:`Loader.path`)
is a list of locations to search for resources.  Locations are searched in the
order given in the path.  If a location is not valid (for example, if the
directory does not exist), it is skipped.

Locations in the path beginning with an "at" symbol (''@'') specify
Python packages.  Other locations specify a ZIP archive or directory on the
filesystem.  Locations that are not absolute are assumed to be relative to the
script home.  Some examples::

    # Search just the `res` directory, assumed to be located alongside the
    # main script file.
    path = ['res']

    # Search the directory containing the module `levels.level1`, followed
    # by the `res/images` directory.
    path = ['@levels.level1', 'res/images']

Paths are always **case-sensitive** and **forward slashes are always used**
as path separators, even in cases when the filesystem or platform does not do this.
This avoids a common programmer error when porting applications between platforms.

The default path is ``['.']``.  If you modify the path, you must call
:py:func:`reindex`.
    )annotationsN)BytesIOStringIO)TYPE_CHECKINGIO)Literal)Batch)Shader)AbstractImageTextureTextureRegion)	Animation)
TextureBin)Source)Scene)AbstractDocumentc                      e Zd ZdZd ZdS )ResourceNotFoundExceptionz4The named resource was not found on the search path.c                H    d| d}t                               | |           d S )Nz
Resource 'zV' was not found on the path.  Ensure that the filename has the correct capitalisation.	Exception__init__selfnamemessages      J/home/agentuser/manim-venv/lib/python3.11/site-packages/pyglet/resource.pyr   z"ResourceNotFoundException.__init__M   s:    N N N N4)))))    N__name__
__module____qualname____doc__r    r   r   r   r   J   s)        >>* * * * *r   r   c                      e Zd ZdZd ZdS )UndetectableShaderTypez6The type of the Shader source could not be identified.c                H    d| d}t                               | |           d S )NzThe Shader type of 'z}' could not be determined. Ensure that your source file has a standard extension, or provide a valid 'shader_type' parameter.r   r   s      r   r   zUndetectableShaderType.__init__V   s<    A$ A A A 	4)))))r   Nr   r$   r   r   r&   r&   S   s)        @@* * * * *r   r&   returnstrc                    t          t          dd          } t          t          dd          }|r|S | dv r)t          j                            t          j                  S | dk    rt          j        d         S t          j        d         }t          |d          rAt          j                            t          j        	                    |j
                            S d	t          j                            t          j                  v rt          j                    S t          j                            t          j                  S )
a  Get the directory containing the program entry module.

    For ordinary Python scripts, this is the directory containing the
    ``__main__`` module. For applications that have been bundled with
    PyInstaller, Nuitka, etc., this may be the bundle path or a
    temporary directory.

    If none of the above cases apply and the file for ``__main__`` cannot
    be determined the working directory is returned.

    When the script is being run by a Python profiler, this function
    may return the directory where the profiler is running instead of
    the directory of the real script. To work around this behaviour the
    full path to the real script can be specified in :py:attr:`pyglet.resource.path`.
    frozenN_MEIPASS)windows_execonsole_exe
macosx_appRESOURCEPATH__main____file__python)getattrsysospathdirname
executableenvironmoduleshasattrabspathr2   basenamegetcwd)r+   meipassmains      r   get_script_homerB   ]   s      S(D))Fc:t,,G 7	1	1	1ws~...	<		z.)){:&4$$ 	77??27??4=#A#ABBB27++CN;;;;y{{" ws~666r   r   c                   t           j        dv r`dt          j        v r0t          j                            t          j        d         |           S t          j                            d|            S t           j        dk    r"t          j                            d|            S t           j                            d          r`dt          j        v r0t          j                            t          j        d         |           S t          j                            d|            S t          j                            d	|            S )
a  Get a directory path to save user preferences.

    Different platforms have different conventions for where to save user
    preferences and settings. This function implements those conventions
    as described below, and returns a fully formed path.

    On Linux, a directory ``name`` in the user's configuration directory is
    returned (usually under ``~/.config``).

    On Windows (including under Cygwin) the ``name`` directory in the user's
    ``Application Settings`` directory is returned.

    On Mac OS X the ``name`` directory under ``~/Library/Application Support``
    is returned.

    .. note:: This function does not perform any directory creation. Users
              should use ``os.path.exists`` and ``os.makedirs`` to construct
              the directory if desired.
    cygwinwin32APPDATA~/darwin~/Library/Application Support/linuxXDG_CONFIG_HOMEz
~/.config/~/.pygletcompat_platformr6   r:   r7   join
expanduser
startswithr   s    r   get_settings_pathrU      s   ( !444
""7<<
9 5t<<<7%%k4kk222		8	+	+w!!"I4"I"IJJJ			*	*7	3	3 0
**7<<
+< =tDDD7%%&94&9&9:::w!!,,,///r   c                   t           j        dv r`dt          j        v r0t          j                            t          j        d         |           S t          j                            d|            S t           j        dk    r"t          j                            d|            S t           j                            d          r`dt          j        v r0t          j                            t          j        d         |           S t          j                            d|            S t          j                            d	|            S )
a   Get a directory to save user data.

    For a Posix or Linux based system many distributions have a separate
    directory to store user data for a specific application and this 
    function returns the path to that location.

    On Linux, a directory ``name`` in the user's data directory is returned
    (usually under ``~/.local/share``).

    On Windows (including under Cygwin) the ``name`` directory in the user's
    ``Application Settings`` directory is returned.

    On Mac OS X the ``name`` directory under ``~/Library/Application Support``
    is returned.

    .. note:: This function does not perform any directory creation. Users
              should use ``os.path.exists`` and ``os.makedirs`` to construct
              the directory if desired.
    rD   rG   rH   rI   rJ   rK   XDG_DATA_HOMEz~/.local/share/rM   rN   rT   s    r   get_data_pathrX      s   ( !444
""7<<
9 5t<<<7%%k4kk222		8	+	+w!!"I4"I"IJJJ			*	*7	3	3 0bj((7<<
? ;TBBB7%%&>&>&>???w!!,,,///r   c                      e Zd ZdZd
ddZd	S )Locationa  Abstract resource location.

    Given a location, a file can be loaded from that location with the
    :py:meth:`open` method. This provides a convenient way to specify a
    path to load files from, even when that path does not reside on the
    filesystem.
    rbr   r)   moder(   BytesIO | StringIO | IOc                     t          d          )a  Open a file at this location.

        Args:
            name:
                The file name to open. Absolute paths are not supported.
                Relative paths are not supported by most locations (you
                should specify only a file name with no path component).
            mode:
                The file mode to open with.  Only files opened on the
                filesystem make use of this parameter; others ignore it.
        abstract)NotImplementedError)r   r   r\   s      r   openzLocation.open   s     "*---r   Nr[   r   r)   r\   r)   r(   r]   )r    r!   r"   r#   ra   r$   r   r   rZ   rZ      s7         . . . . . . .r   rZ   c                  $    e Zd ZdZddZdddZdS )FileLocationzLocation on the filesystem.filepathr)   r(   Nonec                    || _         dS )z4Create a location given a relative or absolute path.Nr7   )r   rf   s     r   r   zFileLocation.__init__       			r   r[   filenamer\   r   c                h    t          t          j                            | j        |          |          S N)ra   r6   r7   rQ   )r   rk   r\   s      r   ra   zFileLocation.open   s$    BGLLH55t<<<r   N)rf   r)   r(   rg   rb   rk   r)   r\   r)   r(   r   r    r!   r"   r#   r   ra   r$   r   r   re   re      sG        %%   = = = = = = =r   re   c                  *    e Zd ZdZddZdddZd ZdS )ZIPLocationzLocation within a ZIP file.
zipfileobjzipfile.ZipFile	directory
str | Nonec                "    || _         || _        dS )aH  Create a location given an open ZIP file and a path within that file.

        Args:
            zipfileobj:
                An open ZIP file from the ``zipfile`` module.
            directory:
                A path within that ZIP file.  Can be empty to specify files at
                the top level of the ZIP file.
        N)zipdir)r   rr   rt   s      r   r   zZIPLocation.__init__   s     r   r[   rk   r)   r(   BytesIO | StringIOc                   | j         r| j          d| n|}|                    t          j        d          }| j                            |          }|dk    r!t          |                                          S t          |          S )zOpen a file from inside the ZipFile.

        Args:
            filename:
                The filename to open.
            mode:
                Valid modes are 'r' and 'rb'.
        /r)	rx   replacer6   seprw   readr   decoder   )r   rk   r\   _path_forward_slash_path_bytess         r   ra   zZIPLocation.open   sz     -1HB48((h((((#mmBFC882333;;FMMOO,,,vr   c                0    | j         j         d| j         dS )Nz(dir='z'))	__class__r    rx   r   s    r   __repr__zZIPLocation.__repr__  s     .)======r   N)rr   rs   rt   ru   rb   )rk   r)   r(   ry   )r    r!   r"   r#   r   ra   r   r$   r   r   rq   rq      sV        %%        > > > > >r   rq   c                  $    e Zd ZdZddZdddZdS )URLLocationz|Location on the network.

    This class uses the ``urllib`` module to open files on
    the network, given a base URL.
    base_urlr)   r(   rg   c                    || _         dS )z#Create a location given a base URL.N)base)r   r   s     r   r   zURLLocation.__init__  rj   r    rk   r\   r   c                    ddl }ddl}|j                            | j        |          }t          |j                            |                                                    S )zOpen a remote file.

        Args:
            filename:
                The name of the remote resource to open.
            mode:
                Unused, as the mode is determined by the remote server.
        r   N)	urllib.parseurllib.requestparseurljoinr   r   requesturlopenr   )r   rk   r\   urlliburls        r   ra   zURLLocation.open  s_     	l""49h77v~--c227799:::r   N)r   r)   r(   rg   )r   rn   ro   r$   r   r   r   r     sK            ; ; ; ; ; ; ;r   r   c                      e Zd ZdZdDdEd	Zd
 ZdFdZd ZdGdHdZdIdZ	dJdZ
dKdZdLd"Z	 	 dMdNd-Z	 	 dOdPd/ZdQd1ZdQd2ZdQd3ZdRd5ZdSdTd8ZdUd:ZdVd<ZdWd>ZdWd?ZdWd@ZdXdYdCZdS )ZLoaderzLoad program resource files from disk.

    The loader contains a search path which can include filesystem
    directories, ZIP archives, URLs, and Python packages.
    Npathlistlist[str] | Nonescript_homeru   r(   rg   c                >   |pdg}t          |t                    r|g}t          |          | _        |pt	                      | _        d| _        i | _        t          j	                    | _
        t          j	                    | _        t          j	                    | _        dS )a  Create a loader for the given path.

        If no path is specified it defaults to ``['.']``; that is,
        just the program directory.

        See the module documentation for details on the path format.

        Args:
            pathlist:
                List of locations to search for resources.
            script_home:
                Base location of relative files. Defaults to
                the result of :py:func:`get_script_home`.
        .N)
isinstancer)   listr7   rB   _script_home_index_texture_atlas_binsweakrefWeakValueDictionary_cached_textures_cached_images_cached_animations)r   r   r   s      r   r   zLoader.__init__3  s     $uh$$ 	" zHNN	'<?+<+<#' $&  !( ; = =%9;;")"="?"?r   c                @    | j         |                                  d S d S rm   )r   reindexr   s    r   _ensure_indexzLoader._ensure_indexS  s#    ;LLNNNNN r   r   r)   locationobjrZ   c                0    || j         vr|| j         |<   d S d S rm   )r   )r   r   r   s      r   _index_filezLoader._index_fileW  s)    t{"" +DK #"r   c                   i | _         | j        D ]N}|                    d          r|dd         }	 t          |          }n# t          t
          f$ r Y Fw xY w|                    d          dd         D ]}t          ||          }t          |d          r%t          j        
                    |j                  }nUd}nRt          j                            |          s3d|vs
J d            t          j                            | j        |          }t          j                            |          r|                    t          j        j                  }t          j        |          D ]\  }}}|t'          |          dz   d         }|r>d	 |                    t          j                  D             }d
                    |          }|D ]4}	|r	|d
z   |	z   }
n|	}
t)          |          }|                     |
|           5d}d}|rt          j                            |          sc|}t          j                            |          \  }}||k    rn8d
                    ||f          }|rt          j                            |          c||k    r|                    d
          }t/          j        |          rt/          j        |d          }|                                D ]v}|                                r||j        vr!|j                            |          }	|	                    d
          }	t=          ||          }|                     |	|           wPdS )zRefresh the file index.

        You must call this method if ``resource.path`` is changed,
        or the filesystem layout changes.
        @   Nr   r2   r   z\\z/Backslashes are not permitted in relative pathsc                    g | ]}||S rm   r$   ).0parts     r   
<listcomp>z"Loader.reindex.<locals>.<listcomp>  s     \ \ \$4K[K[K[K[r   r{   r|   )r   r7   rS   
__import__ImportError
ValueErrorsplitr4   r<   r6   r8   r2   isabsrQ   r   isdirrstripr~   walklenre   r   isfilezipfile
is_zipfileZipFileinfolistis_dirrk   lstriprq   )r   
_path_namemodule_namemodule	componentdirpathdirnames	filenamespartsrk   
index_namefile_locationzip_directoryold_pathtail_dirrr   fileinfos                    r   r   zLoader.reindex[  s    ) F	B F	BJ $$S)) I(n'44FF#Z0   H!,!2!23!7!7!; 8 8I$VY77FF6:.. $!#!A!AJJ!#JJW]]:.. IJ...0a...W\\$*;ZHH
 w}}Z(( 0B'..rw{;;
46GJ4G4G D D0GXy%c*oo&9&:&:;G 2 \ \'--2G2G \ \ \"%((5//$- D D" 2)03)AJJ)1J(4Z(@(@((]CCCCDD& !#  H"'..*D*D H)H+-7==+D+D(J!X--$'HHh-F$G$GM ! H"'..*D*D H )) - 4 4S 9 9%j11 B!(S!A!AJ$.$7$7$9$9 
B 
B#??,, %$(0AAA$#+#4#;#;M#J#J#+??3#7#7(3J(N(N((=AAAAMF	B F	Bs   AAAr[   r\   r]   c                    |                                   	 | j        |         }|                    ||          S # t          $ r t	          |          w xY w)a  Load a file-like object.

        Args:
            name:
                Filename of the resource to load.
            mode:
                Combination of ``r``, ``w``, ``a``, ``b`` and ``t`` characters
                with the meaning as for the builtin ``open`` function.
        )r   r   ra   KeyErrorr   )r   r   r\   r   s       r   filezLoader.file  sf     		2 K-M %%dD111 	2 	2 	2+D111	2s	   "9 Ark   (FileLocation | URLLocation | ZIPLocationc                    |                                   	 | j        |         S # t          $ r t          |          w xY w)aE  Get the location of a resource.

        This method is useful for opening files referenced from a resource.
        For example, an HTML file loaded as a resource might reference some
        images.  These images should be located relative to the HTML file, not
        looked up individually in the loader's path.
        )r   r   r   r   )r   rk   s     r   locationzLoader.location  sQ     		6;x(( 	6 	6 	6+H555	6s   # =c                    |                                   ddlm} |                     |          }|                    |           dS )a  Add a font resource to the application.

        Fonts not installed on the system must be added to pyglet before they
        can be used with ``font.load``. Although the font is added with its
        filename using this function, fonts are always loaded by specifying
        their family name. For example::

            resource.add_font('action_man.ttf')
            action_man = font.load('Action Man')

        r   )fontN)r   rO   r   r   add_file)r   rk   r   fileobjs       r   add_fontzLoader.add_font  sQ     	))H%%gr   	use_atlasboolborderintr   c                   |                      |          }	 t          j                            ||          }|                                 n# |                                 w xY w|s|                                S |                     |j        |j        |          x}r|	                    ||          S |                                S )Nr   )
r   rO   imageloadcloseget_texture_get_texture_atlas_binwidthheightadd)r   r   r   r   r   imgtexture_bins          r   _alloc_imagezLoader._alloc_image  s    ))D//	,##Dw#77CMMOOOOGMMOOOO 	%??$$$ 55ciVTTT; 	0??3///   s   !A A#r   r   TextureBin | Nonec                6   t           j                                        }t          d|          |z
  }||k    s||k    rdS d}||dz  k    rd}	 | j        |         }n=# t
          $ r0 t           j        j                                        }|| j        |<   Y nw xY w|S )zA heuristic for determining the atlas bin to use for a given image
        size.  Returns None if the image should not be placed in an atlas (too
        big), otherwise the bin (a list of TextureAtlas).
        i   Nr         )rO   r   get_max_texture_sizeminr   r   atlasr   )r   r   r   r   max_texture_sizemax_sizebin_sizer   s           r   r   zLoader._get_texture_atlas_bin  s     "<<<>>t-..78v004 HqL  H	=28<KK 	= 	= 	= ,,7799K1<D$X...	= s   A 7BBFr   Tr   flip_xflip_yrotateLiteral[0, 90, 180, 270, 360]r   Texture | TextureRegionc                    |                                   || j        v r| j        |         }n!|                     |||          x}| j        |<   |s|s|s|S |                    |||          S )ay  Load an image with optional transformation.

        This is similar to `texture`, except the resulting image will be
        packed into a :py:class:`~pyglet.image.atlas.TextureBin` (TextureAtlas)
        if it is an appropriate size for packing. This is more efficient than
        loading images into separate textures.

        Args:
            name:
                The filename of the image source to load.
            flip_x:
                If ``True``, the returned image will be flipped horizontally.
            flip_y:
                If ``True``, the returned image will be flipped vertically.
            rotate:
                The returned image will be rotated clockwise by the given
                number of degrees (a multiple of 90).
            atlas:
                If ``True``, the image will be loaded into an atlas managed by
                pyglet. If atlas loading is not appropriate for specific texturing
                reasons (e.g. border control is required) then set to ``False``.
            border:
                Leaves specified pixels of blank space around each image in
                an atlas, which may help reduce texture bleeding.

        .. note:: When using ``flip_x/y`` or ``rotate``, the actual image
                  data is not modified. Instead, the texture coordinates
                  are manipulated to produce the desired result.
        )r   r   r   get_transform)r   r   r   r   r   r   r   identitys           r   r   zLoader.image  s    > 	4&&&*40HH373D3DT5RX3Y3YYHt*40 	f 	V 	O%%fff===r   r   c                   |                                   	 | j        |         }n# t          $ r t          j                            ||                     |                    }|                     |                                |	                                |          }|r|
                    ||           |x}| j        |<   Y nw xY w|s|s|s|S |                    |||          S )a
  Load an animation with optional transformation.

        Animations loaded from the same source but with different
        transformations will use the same textures.

        Args:
            name:
                Filename of the animation source to load.
            flip_x:
                If ``True``, the returned image will be flipped horizontally.
            flip_y:
                If ``True``, the returned image will be flipped vertically.
            rotate:
                The returned image will be rotated clockwise by the given
                number of degrees (must be a multiple of 90).
            border:
                Leaves specified pixels of blank space around each image in
                an atlas, which may help reduce texture bleeding.
        )r   r   r   rO   r   load_animationr   r   get_max_widthget_max_heightadd_to_texture_binr   )	r   r   r   r   r   r   r   
_animationr   s	            r   	animationzLoader.animation-  s   * 	
	B.t4HH 	B 	B 	B44T499T??KKJ55j6N6N6P6P6@6O6O6Q6Q6<> >K  C--k6BBB7AAHt.t444	B  	f 	V 	O%%fff===s   $ BCC	list[str]c                v    |                                   t          | j                                                  S )z{Get a list of animation filenames that have been cached.

        This is useful for debugging and profiling only.
        )r   r   r   keysr   s    r   get_cached_animation_namesz!Loader.get_cached_animation_namesT  s3    
 	D+0022333r   c                v    |                                   t          | j                                                  S )zwGet a list of image filenames that have been cached.

        This is useful for debugging and profiling only.
        )r   r   r   r
  r   s    r   get_cached_image_nameszLoader.get_cached_image_names\  s3    
 	D',,..///r   c                v    |                                   t          | j                                                  S )zyGet a list of texture filenames that have been cached.

        This is useful for debugging and profiling only.
        )r   r   r   r
  r   s    r   get_cached_texture_nameszLoader.get_cached_texture_namesd  s3    
 	D)..00111r   list[TextureBin]c                v    |                                   t          | j                                                  S )zeGet a list of texture bins in use.

        This is useful for debugging and profiling only.
        )r   r   r   valuesr   s    r   get_texture_binszLoader.get_texture_binsl  s3    
 	D,3355666r   	streamingr   c                   |                                   ddlm} 	 | j        |         }t	          t
          t                    r<t          j        	                    |j        |          }|
                    ||          S |                    |          }|
                    |||          S # t          $ r t          |          w xY w)a  Load a sound or video resource.

        The meaning of ``streaming`` is as for :py:func:`~pyglet.media.load`.
        Compressed sources cannot be streamed (that is, video and compressed
        audio cannot be streamed from a ZIP archive).

        Args:
            name:
                Filename of the media source to load.
            streaming:
                True if the source should be streamed from disk, False if
                it should be entirely decoded into memory immediately.
        r   )media)r  )r   r  )r   rO   r  r   r   r   re   r6   r7   rQ   r   ra   r   r   )r   r   r  r  r   	file_pathr   s          r   r  zLoader.mediat  s     	      	2 K-M(L11 KGLL);TBB	zz)yzAAA',,T22zz$W	zJJJ 	2 	2 	2+D111	2s   A"B, ?,B, ,Cr   c                    |                                   || j        v r| j        |         S |                     |          }t          j                            ||                                          }|| j        |<   |S )z)Load an image as a single OpenGL texture.r   )r   r   r   rO   r   r   r   )r   r   r   
textureobjs       r   texturezLoader.texture  sx    4((((..))D//\&&t'&::FFHH
&0d#r   r   c                <   |                                   t          j                            t          j                            |                     |          j                  |          }t          j                            || 	                    |                    S )zLoad a 3D Scene.)rk   r   )
r   r6   r7   rQ   r=   r   rO   modelr   r   )r   r   abspathnames      r   scenezLoader.scene  sk    gll27??4==3F3F3K#L#LdSS|  +DIIdOO LLLr   r   c                    |                                   |                     |          }t          j                            ||d          S )zLoad an HTML document.z	text/htmlr   r   rO   textr   r   r   r   s      r   htmlzLoader.html  s=    ))D//{g{;;;r   c                    |                                   |                     |          }t          j                            ||d          S )ztLoad an attributed text document.

        See `pyglet.text.formats.attributed` for details on this format.
        ztext/vnd.pyglet-attributedr   r"  s      r   
attributedzLoader.attributed  s@    
 	))D//{g/KLLLr   c                    |                                   |                     |          }t          j                            ||d          S )zLoad a plain text document.z
text/plainr   r"  s      r   r!  zLoader.text  s=    ))D//{g|<<<r   shader_typer
   c                   |                                   ddddddd}|                     |d          }|                                }|s]	 t          j                            |          \  }}||                    d	                   }n# t          $ r t          |
          w xY w||	                                vrt          |
          t          j        j                            ||          S )a`  Load a Shader object.

        Args:
            name:
                Filename of the Shader source to load.
            shader_type:
                A hint for the type of shader, such as 'vertex', 'fragment', etc.
                Not required if your shader has a standard file extension, such
                as ``.vert``, ``.frag``, etc..
        computefragmentgeometry
tescontroltesevaluationvertex)compfraggeomtesctesevertr|   r   rT   )r   r   r   r6   r7   splitextstripr   r&   r  rO   graphicsshaderr
   )r   r   r'  shader_extensionsr   source_string_	extensions           r   r8  zLoader.shader  s    	%.%/%/%1%4%-/ / ))D#&& 	88!w//559/	0D0DE 8 8 8,$77778 /668888(d3333%,,]KHHHs   =B	 	B$)NN)r   r   r   ru   r(   rg   )r   r)   r   rZ   r(   rg   rb   rc   )rk   r)   r(   r   )rk   r)   r(   rg   )r   r)   r   r   r   r   r(   r   )r   r   r   r   r   r   r(   r   )FFr   Tr   )r   r)   r   r   r   r   r   r   r   r   r   r   r(   r   )FFr   r   )r   r)   r   r   r   r   r   r   r   r   r(   r   )r(   r  )r(   r  )T)r   r)   r  r   r(   r   )r   r)   r(   r   )r   r)   r(   r   )r   r)   r(   r   rm   )r   r)   r'  ru   r(   r
   )r    r!   r"   r#   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r#  r%  r!  r8  r$   r   r   r   r   -  s        
@ @ @ @ @@  , , , ,MB MB MB^2 2 2 2 2"6 6 6 6   "! ! ! !    2 tu01(> (> (> (> (>T INKL%> %> %> %> %>N4 4 4 40 0 0 02 2 2 27 7 7 72 2 2 2 2:	 	 	 	M M M M< < < <M M M M= = = = I  I  I  I  I  I  Ir   r   c                  D    e Zd Zed             Zej        d             ZdS )_DefaultLoaderc                    t           S rm   ri   r   s    r   r7   z_DefaultLoader.path  s    r   c                
    |a d S rm   ri   )r   values     r   r7   z_DefaultLoader.path  s     r   N)r    r!   r"   propertyr7   setterr$   r   r   r>  r>    sJ          X 
[  [  r   r>  )r(   r)   )r   r)   r(   r)   )@r#   
__future__r   r6   r5   r   r   ior   r   typingr   r   rO   r   pyglet.graphicsr	   pyglet.graphics.shaderr
   pyglet.imager   r   r   pyglet.image.animationr   pyglet.image.atlasr   pyglet.media.codecsr   pyglet.modelr   pyglet.text.documentr   r   r   r&   rB   rU   rX   rZ   re   rq   r   r   r7   r>  _default_loaderr   r   r   r   r   r  r  r  r#  r%  r!  r  r8  r  r  r  r  r$   r   r   <module>rP     s|  0 0b # " " " " " 				 



                   $ $ $ $ $ $ $ $  	6%%%%%%------BBBBBBBBBB000000------******""""""555555* * * * *	 * * ** * * * *Y * * *$7 $7 $7 $7N!0 !0 !0 !0H!0 !0 !0 !0H. . . . . . . .0= = = = =8 = = =!> !> !> !> !>( !> !> !>H; ; ; ; ;( ; ; ;4jI jI jI jI jI jI jI jIj 
	 	 	 	 	V 	 	 	 !.""

!##%	

!'
		*C (? ,G "3   r   