
    3jl                     >   S r SSKJrJrJr  SSKJrJr  SSKrSSKJ	r	J
r
  SSK7  SSKJr  S r\R                  " \5      R                  S	\
R                   S
SS9r\R                  " \5      R                  SSSS9R                  SS SSS9rSSKJr  SSKJr  SS jrg)a  OpenGL extension ARB.sync

This module customises the behaviour of the 
OpenGL.raw.GL.ARB.sync to provide a more 
Python-friendly API

Overview (from the spec)
        
        This extension introduces the concept of "sync objects". Sync
        objects are a synchronization primitive - a representation of events
        whose completion status can be tested or waited upon. One specific
        type of sync object, the "fence sync object", is supported in this
        extension, and additional types can easily be added in the future.
        
        Fence sync objects have corresponding fences, which are inserted
        into the OpenGL command stream at the time the sync object is
        created. A sync object can be queried for a given condition. The
        only condition supported for fence sync objects is completion of the
        corresponding fence command. Fence completion allows applications to
        request a partial Finish, wherein all commands prior to the fence
        will be forced to complete before control is returned to the calling
        process.
        
        These new mechanisms allow for synchronization between the host CPU
        and the GPU, which may be accessing the same resources (typically
        memory), as well as between multiple GL contexts bound to multiple
        threads in the host CPU.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/ARB/sync.txt
    )platformconstantarrays)
extensionswrapperN)_types_glgets)*)_EXTENSION_NAMEc                  :    SSK Jn   U R                  " [        5      $ )z=Return boolean indicating whether this extension is availabler   r   )OpenGLr   hasGLExtensionr   r   s    L/home/wildlama/miniconda3/lib/python3.13/site-packages/OpenGL/GL/ARB/sync.pyglInitSyncARBr   '   s    !$$o77    datapnameT)sizepnameArgorPassInlength)   )r   r   valuesc                     U 4$ )N )xs    r   <lambda>r   2   s    A4r   count)GLint)
GLintArrayc                     Uc  [         R                  " U45      nUc
  [        5       n[        XX#U5        UR                  nUSU $ )a  Wrapper around glGetSynciv that auto-allocates buffers

sync -- the GLsync struct pointer (see glGetSynciv)
pname -- constant to retrieve (see glGetSynciv)
bufSize -- defaults to 1, maximum number of items to retrieve,
    currently all constants are defined to return a single 
    value 
length -- None or a GLint() instance (ONLY!), must be a byref()
    capable object with a .value attribute which retrieves the 
    set value
values -- None or an array object, if None, will be a default 
    return-array-type of length bufSize

returns values[:length.value], i.e. an array with the values set 
by the call, currently always a single-value array.
N)r!   zerosr    glGetSyncivvalue)syncr   bufSizer   r   writtens         r   	glGetSyncr)   8   sI    " ~!!G:/~gv7llG(7r   )r   NN)__doc__r   r   r   r   r   r   ctypesOpenGL.raw.GLr   r	   OpenGL.raw.GL.ARB.syncr   r   glGetInteger64v	setOutput_glget_size_mappingr$   OpenGL.raw.GL._typesr    OpenGL.arraysr!   r)   r   r   r   <module>r3      s   > . - &  ) $ 28
 0::
++Wd ;  OOK(22$ 3 )-$    ' $r   