
    \
j                         d Z ddlT ddlZddlT ddlmZ  G d d          Z e            Zej        Zej	        Z	ej
        Z
ej        Zej        ZdS )aS  Information about version and extensions of current GLU implementation.

Usage::

    from pyglet.gl import glu_info

    if glu_info.have_extension('GLU_EXT_nurbs_tessellator'):
        # ...

If multiple contexts are in use you can use a separate GLUInfo object for each
context.  Call `set_active_context` after switching to the desired context for
each GLUInfo::

    from pyglet.gl.glu_info import GLUInfo

    info = GLUInfo()
    info.set_active_context()
    if info.have_version(1, 3):
        # ...

Note that GLUInfo only returns meaningful information if a context has been
created.
    )*N)asstrc                   B    e Zd ZdZdZdZg ZdZd ZddZ	d Z
d Zd	 Zd
S )GLUInfoax  Information interface for the GLU library. 

    A default instance is created automatically when the first OpenGL context
    is created.  You can use the module functions as a convenience for 
    this default instance's methods.

    If you are using more than one context, you must call `set_active_context`
    when the context is active for this `GLUInfo` instance.
    Fz0.0.0c                 P   d| _         | j        st          t          t	          t
                    t                    j                                                  | _	        t          t          t	          t                    t                    j                  | _        d| _        dS dS )zStore information for the currently active context.

        This method is called automatically for the default context.
        TN)have_context
_have_infor   castgluGetStringGLU_EXTENSIONSc_char_pvaluesplit
extensionsGLU_VERSIONversionselfs    L/DATA/AppData/hermes/venv/lib/python3.11/site-packages/pyglet/gl/glu_info.pyset_active_contextzGLUInfo.set_active_contextS   s    
 ! 	##Dn)E)Ex$P$P$VWW]]__DO l;&?&?!J!J!PQQDL"DOOO	# 	#    r   c                     | j         st          j        d           d| j                            dd          d         z  }d |                    dd          d	d         D             \  }}}||k    p||k    o||k    p||k    o||k    o||k    S )
a  Determine if a version of GLU is supported.

        :Parameters:
            `major` : int
                The major revision number (typically 1).
            `minor` : int
                The minor revision number.
            `release` : int
                The release number.  

        :rtype: bool
        :return: True if the requested or a later version is supported.
        No GL context created yet.z%s.0.0    r   c                 ,    g | ]}t          |          S  )int).0vs     r   
<listcomp>z(GLUInfo.have_version.<locals>.<listcomp>o   s    #J#J#JqCFF#J#J#Jr   .   N)r   warningswarnr   r   )r   majorminorreleaseverimajoriminorireleases           r   have_versionzGLUInfo.have_version^   s       	8M6777++C33A66#J#JCIIc14E4Ebqb4I#J#J#J ~ M%2FUNM%KFeOKG8K	Mr   c                 F    | j         st          j        d           | j        S )z[Get the current GLU version.

        :return: the GLU version
        :rtype: str
        r   )r   r$   r%   r   r   s    r   get_versionzGLUInfo.get_versiont   s(       	8M6777|r   c                 J    | j         st          j        d           || j        v S )a-  Determine if a GLU extension is available.

        :Parameters:
            `extension` : str
                The name of the extension to test for, including its
                ``GLU_`` prefix.

        :return: True if the extension is provided by the implementation.
        :rtype: bool
        r   r   r$   r%   r   )r   	extensions     r   have_extensionzGLUInfo.have_extension~   s-       	8M6777DO++r   c                 F    | j         st          j        d           | j        S )zGet a list of available GLU extensions.

        :return: a list of the available extensions.
        :rtype: list of str
        r   r1   r   s    r   get_extensionszGLUInfo.get_extensions   s(       	8M6777r   N)r   r   )__name__
__module____qualname____doc__r   r   r   r	   r   r-   r/   r3   r5   r   r   r   r   r   C   s          LGJJ	# 	# 	#M M M M,  , , ,    r   r   )r9   ctypesr$   pyglet.gl.glupyglet.utilr   r   	_glu_infor   r-   r/   r3   r5   r   r   r   <module>r>      s   H 0               R R R R R R R Rn GII	1 %#))r   