
    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)a  Darwin (MacOSX)-specific platform features

This was implemented with the help of the following links:
[1] Apple's Mac OS X OpenGL interfaces: http://developer.apple.com/qa/qa2001/qa1269.html
[2] As above, but updated: http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_pg_concepts/chapter_2_section_3.html
[3] CGL reference: http://developer.apple.com/documentation/GraphicsImaging/Reference/CGL_OpenGL/index.html#//apple_ref/doc/uid/TP40001186
[4] Intro to OpenGL on Mac OS X: http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_intro/chapter_1_section_1.html#//apple_ref/doc/uid/TP40001987-CH207-TP9

About the  CGL API, (from [1]):
CGL or Core OpenGL is the lowest accessible interface API for OpenGL. 
It knows nothing about windowing systems but can be used directly to 
find both renderer information and as a full screen or off screen 
interface. It is accessible from both Cocoa and Carbon and is what both 
NSGL and AGL are built on. A complete Pbuffer interface is also provided. 
Functionality is provided in via the OpenGL framework and applications 
can include the OpenGL.h header to access CGL's functionality. Developers
can see an example of using CGL with Carbon in the Carbon CGL code sample.

Documentation and header files are found in:
/System/Library/Frameworks/OpenGL.framework
/System/Library/Frameworks/GLUT.framework

    N)baseplatformctypesloaderc                   B   \ rS rSrSr\" \R                  5      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S
 r\
R                  S 5       rSrg)DarwinPlatform   z$Darwin (OSX) platform implementationTc                      [         R                  " [        R                  S[        R                  S9$ ! [
         a  n[        S/UR                  Q76 eS nAff = f)NOpenGL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/darwin.pyGLDarwinPlatform.GL    sW    	J++'' 
  	J=III	Js   14 
AAAc                     U R                   $ Nr   r   s    r   GLUDarwinPlatform.GLU*       ''>    c                     U R                   $ r   r   r   s    r   CGLDarwinPlatform.CGL,   r   r   c                      [         R                  " [        R                  S[        R                  S9$ ! [
         a     g f = f)NGLUTr
   )r   r   r   r   r   r   r   s    r   r$   DarwinPlatform.GLUT/   sA    	++'' 
  		s   14 
A Ac                     U R                   $ r   )r$   r   s    r   GLEDarwinPlatform.GLE9   s    ))#r   c                 \    U R                   R                  n[        R                  Ul        U$ r   )r!   CGLGetCurrentContextr   c_void_prestype)r   r*   s     r   GetCurrentContext DarwinPlatform.GetCurrentContext<   s%    #xx<<'-$##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 )aY  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.
_   Nglut )splittitlejoinr   r+   in_dllr$   	addressof)r   constantxnameinternalpointers         r   getGLUTFontPointer!DarwinPlatform.getGLUTFontPointerB   s     %-NNC$9!"$=?$=q$=?BGG%>Aggi%>@@//(($))X?v//899 @%>s   B8B=
c                 .    U R                   R                  $ r   )r   
glGetErrorr   s    r   rA   DarwinPlatform.glGetErrorR   s    ww!!!r    N)__name__
__module____qualname____firstlineno____doc__staticmethodr   	CFUNCTYPEDEFAULT_FUNCTION_TYPEEXTENSIONS_USE_BASE_FUNCTIONSr   lazy_propertyr   r   r!   r$   r'   r-   r>   rA   __static_attributes__rC   r   r   r   r      s    .(&*:*:<$(!J  J !  !!  !   #  #$  $
:  "  "r   r   )rH   r   ctypes.utilOpenGL.platformr   r   BasePlatformr   rC   r   r   <module>rR      s$   .  69"l// 9"r   