
    3j                     j    S r SSKrSSKrSSKJrJr  SSKJr  SSKJ	r	   " S S\R                  5      rg)zOSMesa-specific features

To request an OSMesa context, you need to run your script with:

    PYOPENGL_PLATFORM=osmesa

defined in your shell/execution environment.
    N)baseplatformctypesloader)Constant)_typesc                      \ rS rSrSr\R                  R                  SS S/-   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\R                  S 5       r\R                  S 5       rS rSrg)OSMesaPlatform   z"OSMesa implementation for PyOpenGLNOSMesac                      [         R                  " [        R                  S[        R                  S9$ ! [
         a  n[        S/UR                  Q76 eS nAff = f)Nr
   modezUnable to load OpenGL library)r   loadLibraryctypescdllRTLD_GLOBALOSErrorImportErrorargsselferrs     P/home/wildlama/miniconda3/lib/python3.13/site-packages/OpenGL/platform/osmesa.pyGLOSMesaPlatform.GL   sW    	J++'' 
  	J=III	Js   14 
AAAc                      [         R                  " [        R                  S[        R                  S9$ ! [
         a
  n S nAg S nAff = f)NGLUr   r   r   r   r   r   r   r   s     r   r   OSMesaPlatform.GLU   B    	++'' 
  		   14 
AAc                      [         R                  " [        R                  S[        R                  S9$ ! [
         a
  n S nAg S nAff = f)Nglutr   r   r   s     r   GLUTOSMesaPlatform.GLUT'   sB    	++'' 
  		r    c                      [         R                  " [        R                  S[        R                  S9$ ! [
         a
  n S nAg S nAff = f)Ngler   r   r   s     r   GLEOSMesaPlatform.GLE1   r   r    c                     U R                   $ N)r   r   s    r   r
   OSMesaPlatform.OSMesa;   s    #ww    c                 \    U R                   R                  n[        R                  Ul        U$ r*   )r
   OSMesaGetCurrentContextr   OSMesaContextrestyper   functions     r   GetCurrentContext OSMesaPlatform.GetCurrentContext@   s$    ;;66!//r-   c                     U R                   $ r*   )r4   r+   s    r   CurrentContextIsValid$OSMesaPlatform.CurrentContextIsValidE   s    .2.D.D'Dr-   c                 \    U R                   R                  n[        R                  Ul        U$ r*   )r
   OSMesaGetProcAddressr   c_void_pr1   r2   s     r   getExtensionProcedure$OSMesaPlatform.getExtensionProcedureH   s"    ;;33!??r-   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 )aa  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xnameinternalpointers         r   getGLUTFontPointer!OSMesaPlatform.getGLUTFontPointerN   s     %-NNC$9!"$=?$=q$=?BGG%>Aggi%>@@//(($))X?v//899 @%>s   B8B=
 )__name__
__module____qualname____firstlineno____doc__r   BasePlatformEXPORTED_NAMESlazy_propertyr   r   r#   r'   r
   staticmethodr   	CFUNCTYPEDEFAULT_FUNCTION_TYPEr4   r7   r<   rL   __static_attributes__rN   r-   r   r   r      s   ,!..==a@D N J  J          &  &(&*:*:<   D  D  
:r-   r   )rS   r   ctypes.utilOpenGL.platformr   r   OpenGL.constantr   OpenGL.raw.osmesar   rT   r   rN   r-   r   <module>r_      s,     6 $ $N:l// N:r-   