
    \
jI                     $   d Z ddlT ddlT ddlmZ ddlT ddlmZ ddlZ	ddlm
Z
 ddlmZmZmZ ddlZ eed	          oej        ZdZ G d
 de          Z G d de          Ze	j        d         rdai Zdad Zd ZeZd Ze Z!d Z e"Z#d Z"d Z$erddlm%Z% nBe	j        d         rddl&m'Z% n.e
dv rddl(m)Z% n# e
j*        d          rddl+m,Z% ne
dk    rddl-m.Z% da/es.dej0        vr'e	j        d         rej0        e1         e	_2        ddl3ZdS dS dS dS ) a  OpenGL and GLU interface.

This package imports all OpenGL, GLU and registered OpenGL extension
functions.  Functions have identical signatures to their C counterparts.  For
example::

    from pyglet.gl import *

    # [...omitted: set up a GL context and framebuffer]
    glBegin(GL_QUADS)
    glVertex3f(0, 0, 0)
    glVertex3f(0.1, 0.2, 0.3)
    glVertex3f(0.1, 0.2, 0.3)
    glEnd()

OpenGL is documented in full at the `OpenGL Reference Pages`_.

The `OpenGL Programming Guide`_ is a popular reference manual organised by
topic.  The free online version documents only OpenGL 1.1.  `Later editions`_
cover more recent versions of the API and can be purchased from a book store.

.. _OpenGL Reference Pages: http://www.opengl.org/documentation/red_book/
.. _OpenGL Programming Guide: http://fly.cc.fer.hr/~unreal/theredbook/
.. _Later editions: http://www.opengl.org/documentation/red_book/

The following subpackages are imported into this "mega" package already (and
so are available by importing ``pyglet.gl``):

``pyglet.gl.gl``
    OpenGL
``pyglet.gl.glu``
    GLU
``pyglet.gl.gl.glext_arb``
    ARB registered OpenGL extension functions

These subpackages are also available, but are not imported into this namespace
by default:

``pyglet.gl.glext_nv``
    nVidia OpenGL extension functions
``pyglet.gl.agl``
    AGL (Mac OS X OpenGL context functions)
``pyglet.gl.glx``
    GLX (Linux OpenGL context functions)
``pyglet.gl.glxext_arb``
    ARB registered GLX extension functions
``pyglet.gl.glxext_nv``
    nvidia GLX extension functions
``pyglet.gl.wgl``
    WGL (Windows OpenGL context functions)
``pyglet.gl.wglext_arb``
    ARB registered WGL extension functions
``pyglet.gl.wglext_nv``
    nvidia WGL extension functions

The information modules are provided for convenience, and are documented
below.
    )*)GLException)gl_infoN)compat_platform   )ObjectSpaceCanvasConfigContextis_pyglet_doc_runc                       e Zd ZdS )ContextExceptionN__name__
__module____qualname__     L/DATA/AppData/hermes/venv/lib/python3.11/site-packages/pyglet/gl/__init__.pyr   r   z           Dr   r   c                       e Zd ZdS )ConfigExceptionNr   r   r   r   r   r   ~   r   r   r   debug_texturec                 `    |t           | <   t          |z  at          dt          |fz             d S )Nz%d (+%d)_debug_texture_sizes_debug_texture_totalprinttexturesizes     r   _debug_texture_allocr!      s9     )-W%$j0$7788888r   c                 v    t           |          }t           | = t          |z  at          dt          |fz             d S )Nz%d (-%d)r   r   s     r   _debug_texture_deallocr#      s@     $G, )$j0$7788888r   c                 &    |a t          | |          S )N)_debug_texture_glBindTexture)targetr   s     r   glBindTexturer(      s     fg...r   c	                 J   	 t          t                     n# t          $ r Y nw xY w|dt          t          t
          fv rd}	n$|dt          t          fv rd}	n|dt          fv rd}	nd}	|d|z  z   |d|z  z   z  |	z  }
t          t          |
           t          | ||||||||	  	        S )Nr            )r#   r%   KeyErrorGL_ALPHAGL_INTENSITYGL_LUMINANCEGL_RGB16	GL_RGBA16GL_RGBr!   _glTexImage2D)r'   levelinternalformatwidthheightborderformattypepixelsdepthr    s              r   glTexImage2Dr>      s    	">2222 	 	 	D	 a<FFFEE8Y777EE6{**EEEF
"vF
':;eC^T222VUNE66SY[_aghhhs    
$$c                     t          |d          st          |j                   n,t          |           D ]}t          ||         j                   t	          | |          S )N__len__)hasattrr#   valuerange_glDeleteTextures)ntexturesis      r   glDeleteTexturesrH      sd    x++ 	:"8>22221XX : :&x{'89999 H---r   c                      dd l } | j        d         rt          rd S ddlm}  |ddd          at
                                           ddl m} |j        	                    t
                     d S )Nr   shadow_window)Windowr   F)r7   r8   visible)app)
pygletoptions_is_pyglet_doc_runpyglet.windowrK   _shadow_window	switch_torM   windowsremove)rN   rK   rM   s      r   _create_shadow_windowrV      s     MMM>/* .@ $$$$$$V!Au===NK~&&&&&r   )Configheadless)HeadlessConfig)win32cygwin)Win32Configlinux)
XlibConfigdarwin)CocoaConfigzpyglet.windowrJ   )4__doc__pyglet.gl.glpyglet.gl.glupyglet.gl.libr   pyglet.gl.glext_arb	pyglet.glr   rN   _pygletr   baser   r	   r
   sys_sysrA   r   rP   current_context	Exceptionr   r   rO   r   r   r%   r!   r#   r(   r&   r>   r4   rH   rD   rV   rW   rX   rY   rZ   r\   
startswithxlibr^   cocoar`   rR   modulesr   glrQ   r   r   r   <module>rr      s  H9 9v         % % % % % % ! ! ! !           " " " " " " 4 4 4 4 4 4 4 4 4 4    WT#677RD<R  	 	 	 	 	y 	 	 		 	 	 	 	i 	 	 	 ??# A.N9 9 99 9 9 #N/ / / !Mi i i( ). . .' ' '  
-_Z  -2222222+++,,,,,,,_(( -*******  ,,,,,,   oT\AAgoVeFfAh'GJ AAAAr   