
    3j                     R    S r SSKrSSKrSSKJrJr   " S S\R                  5      rg)z*GLX (x-windows)-specific platform features    N)baseplatformctypesloaderc                      \ rS rSrSr\R                  S 5       r\R                  S 5       r\R                  S 5       r	\R                  S 5       r
\R                  S 5       r\R                  S 5       r\R                  S	 5       r\R                  S
 5       r\R                  S 5       r\R                  S 5       r\R                  S 5       r\" \R(                  5      r\R                  S 5       rS r\R                  S 5       rSrg)GLXPlatform   z=Posix (Linux, FreeBSD, etceteras) implementation for PyOpenGLc                     S HA  n [         R                  " [        R                  U[        R                  S9nU(       d  M?  Us  $    [        S5      e! [
         a  nS n S nAN+S nAff = f)N)OpenGLGLmodez#Unable to load OpenGL or GL library)r   loadLibraryctypescdllRTLD_GLOBALOSErrorImportErrorselfnameliberrs       M/home/wildlama/miniconda3/lib/python3.13/site-packages/OpenGL/platform/glx.pyr
   GLXPlatform.GL   sc    $D"..KKF,>,>
 s
 % ?@@	  s   2A
A)A$$A)c                      [         R                  " [        R                  S[        R                  S9$ ! [
         a     g f = f)NGLUr   r   r   r   r   r   r   r   s    r   r   GLXPlatform.GLU   8    	++FKKVEWEWXX 		   14 
A Ac                      [         R                  " [        R                  S[        R                  S9$ ! [
         a     g f = f)Nglutr   r   r   s    r   GLUTGLXPlatform.GLUT!   s?    	++V&*<*<   		r    c                      S HT  n[         R                  " [        R                  U[        R                  S9nU(       d  M>  [        USS 5      (       d  MR  Us  $    g ! [         a  nU R                  s S nA$ S nAff = f)N)GLXr	   r
   r   glXCreateContext)r   r   r   r   r   getattrr   r
   r   s       r   r&   GLXPlatform.GLX*   sh    	/"..KKF,>,> 373(:DAAJ 0  	77N	s/   <A A A A 
A='A82A=8A=c                      [         R                  " [        R                  S[        R                  S9$ ! [
         a     g f = f)N	GLESv1_CMr   r   r   s    r   GLES1GLXPlatform.GLES16   s?    	++[v/A/A   		r    c                      [         R                  " [        R                  S[        R                  S9$ ! [
         a     g f = f)NGLESv2r   r   r   s    r   GLES2GLXPlatform.GLES2?   s?    	++XF,>,>   		r    c                     U R                   $ N)r0   r   s    r   GLES3GLXPlatform.GLES3H   s     zz    c                 L    [         R                  " [        R                  S5      $ )NEGL)r   r   r   r   r   s    r   r8   GLXPlatform.EGLM   s    ''U;;r6   c                 \    U R                   R                  n[        R                  Ul        U$ r3   )r&   glXGetProcAddressARBr   c_void_prestype)r   bases     r   r;    GLXPlatform.glXGetProcAddressARBQ   s!    xx,,r6   c                     U R                   $ r3   )r;   r   s    r   getExtensionProcedure!GLXPlatform.getExtensionProcedureW   s    (((r6   c                      [         R                  " [        R                  S[        R                  S9$ ! [
         a     g f = f)Ngler   r   r   s    r   GLEGLXPlatform.GLE[   r   r    c                 \    U R                   R                  n[        R                  Ul        U$ r3   )r&   glXGetCurrentContextr   r<   r=   )r   rH   s     r   GetCurrentContextGLXPlatform.GetCurrentContextf   s%    #xx<<'-$##r6   c                    UR                  S5      SS  Vs/ s H  o"R                  5       PM     nnSSR                  U Vs/ s H  o"R                  5       PM     sn5      -   n[        R                  R                  U R                  U5      n[        R                  " [        R                  " U5      5      $ s  snf s  snf )a`  Platform specific function to retrieve a GLUT font pointer

GLUTAPI void *glutBitmap9By15;
#define GLUT_BITMAP_9_BY_15             (&glutBitmap9By15)

Key here is that we want the addressof the pointer in the DLL,
not the pointer in the DLL.  That is, our pointer is to the
pointer defined in the DLL, we don't want the *value* stored in
that pointer.
_   Nr"    )splittitlejoinr   r<   in_dllr#   	addressof)r   constantxr   internalpointers         r   getGLUTFontPointerGLXPlatform.getGLUTFontPointerl   s     $,>>##6qr#:;#:a	#:;BGG$=1WWY$=>>//((H=v//899 <$=s   B8B=
c                 .    U R                   R                  $ r3   )r
   
glGetErrorr   s    r   r[   GLXPlatform.glGetError|   s    ww!!!r6    N)__name__
__module____qualname____firstlineno____doc__r   lazy_propertyr
   r   r#   r&   r,   r0   r4   r8   r;   rA   rE   staticmethodr   	CFUNCTYPEDEFAULT_FUNCTION_TYPErI   rX   r[   __static_attributes__r]   r6   r   r   r      sq   G
 
A  
A       	  	          <  <   
 )  )    ))9)9: $  $
:  "  "r6   r   )rb   r   ctypes.utilOpenGL.platformr   r   BasePlatformr   r]   r6   r   <module>rk      s"    0  6w",++ w"r6   