
    3j*              
       	   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	S5      R                  S
S5      r\R                  " \5      R                  SS5      r\R                  " \5      R                  SS5      r\R                  " \5      R                  SS5      r\R                  " \5      R                  SS5      r\R                  " \5      R                  SS5      r\R                  " \5      R                  SS5      r\R                  " \5      R                  SS5      r\R                  " \5      R                  SS5      r\R                  " \5      R                  SS5      r\R                  " \5      R                  SS5      r\R                  " \5      R                  SS5      r\R                  " \5      R9                  S\
R:                  SSS9r\R                  " \5      R9                  S\
R:                  SSS9r\R                  " \5      R9                  SS SSS9R9                  S	SSS9r\R                  " \ 5      R9                  SSSS9R9                  SS SSS9r \R                  " \!5      R9                  S	SSS9R9                  SS SSS9R9                  SSSS9R9                  SSSS9r!\R                  " \"5      R9                  S	SSS9R9                  SS SSS9r"SSKrSSK#J$r$J%r%J&r&  SS KJ'r'  SS!K(J)r*  SS"KJ+r+J,r,  \RZ                  " S#S$5      r.\R^                  " S%\R`                  Rb                  S\	Rd                  \	Rf                  \Rh                  " \Rj                  5      \Rl                  4S&S'\S(9r\+Rn                  " S
S)9r8\R                  " \5      Rs                  S5      Rs                  S	5      Rs                  S
\8Rt                  5      Rw                  S
\8Rx                  5      R{                  S	\85      R{                  S\8R|                  5      r C8S* rA\R                  (       a  \A" \C5      \DlE        \R                  (       a  \A" \F5      \GlE        \*" \5      S+ 5       r\*" \ 5      S, 5       r \*" \"5      S- 5       r"\*" \!5      S0S. j5       r!\*" \H5      S/ 5       rHg! \? a
  r@ Sr@C@NSr@C@ff = f)1aK	  OpenGL extension ARB.shader_objects

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

Overview (from the spec)
        
        This extension adds API calls that are necessary to manage shader
        objects and program objects as defined in the OpenGL 2.0 white papers by
        3Dlabs.
        
        The generation of an executable that runs on one of OpenGL's
        programmable units is modeled to that of developing a typical C/C++
        application. There are one or more source files, each of which are
        stored by OpenGL in a shader object. Each shader object (source file)
        needs to be compiled and attached to a program object. Once all shader
        objects are compiled successfully, the program object needs to be linked
        to produce an executable. This executable is part of the program object,
        and can now be loaded onto the programmable units to make it part of the
        current OpenGL state. Both the compile and link stages generate a text
        string that can be queried to get more information. This information
        could be, but is not limited to, compile errors, link errors,
        optimization hints, etc. Values for uniform variables, declared in a
        shader, can be set by the application and used to control a shader's
        behavior.
        
        This extension defines functions for creating shader objects and program
        objects, for compiling shader objects, for linking program objects, for
        attaching shader objects to program objects, and for using a program
        object as part of current state. Functions to load uniform values are
        also defined. Some house keeping functions, like deleting an object and
        querying object state, are also provided.
        
        Although this extension defines the API for creating shader objects, it
        does not define any specific types of shader objects. It is assumed that
        this extension will be implemented along with at least one such
        additional extension for creating a specific type of OpenGL 2.0 shader
        (e.g., the ARB_fragment_shader extension or the ARB_vertex_shader
        extension).

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/ARB/shader_objects.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    V/home/wildlama/miniconda3/lib/python3.13/site-packages/OpenGL/GL/ARB/shader_objects.pyglInitShaderObjectsARBr   4   s    !$$o77    lengthstringvalueparamspnameT)sizepnameArgorPassIninfoLogc                     U 4$ N xs    r   <lambda>r!   s   s    QDr   	maxLength)   )r   r   countobjc                     U 4$ r   r   r   s    r   r!   r!   z   s    r   maxCountnamec                     U 4$ r   r   r   s    r   r!   r!      s    !r   r   typesourcec                     U 4$ r   r   r   s    r   r!   r!      s    A4r   )bytes_NULL_8_BYTEas_8_bit)_errors)lazy)
converterserrorGL_INFO_LOG_LENGTH_ARBi  glShaderSourceARBzHglShaderSourceARB( GLhandleARB(shaderObj), [bytes(string),...] ) -> None)	shaderObjr$   r   r   )dll
resultTypeargTypesdocargNames	extension)r(   c                    ^  SU 4S jjnU$ )z>Generate an error-checking function for compilation operationsc           	         > [         R                  R                  " XU/UQ76 n [        US   T5      nU(       d#  [        R
                  " U UU[        US   5      S9eU $ )Nr   )resultbaseOperation
cArgumentsdescription)r0   _error_checkerglCheckErrorglGetObjectParameterivARBr3   GLErrorglGetInfoLogARB)r?   r@   rA   argsstatuskeys        r   GLSLCheckError#_afterCheck.<locals>.GLSLCheckError   sh    ''44:
04
 +:a=#>--+%+JqM:	  r   )NNr   )rJ   rK   s   ` r   _afterCheckrM      s     r   c                     [        [        U[        5      5      nUS:  a?  [        R                  " U5      nU " XSU5        UR
                  R                  [        5      $ g)zjRetrieve the program/shader's error messages as a Python string

returns string which is '' if no message
r   N )intrE   r4   ctypescreate_string_bufferr   stripr.   )r@   r%   r   logs       r   rG   rG      sP     *30FGHFz))&1c4-yy|,,r   c                     [        U[        5      nUS:  a,  [        R                  R	                  U45      nU " XSU5        U$ [        R                  R	                  S5      $ )zBRetrieve the attached objects as an array of GLhandleARB instancesr   N)r   )rE   GL_OBJECT_ATTACHED_OBJECTS_ARBr   GLuintArrayzeros)r@   r%   r   storages       r   glGetAttachedObjectsARBrZ      sX     's,JKFz$$**F95c41##D))r   c                     [        [        U[        5      5      nUS:  a?  [        R                  " U5      nU " XSU5        UR
                  R                  [        5      $ g)zkRetrieve the program/shader's source code as a Python string

returns string which is '' if no source code
r   NrO   )rP   rE   "GL_OBJECT_SHADER_SOURCE_LENGTH_ARBrQ   rR   r   rS   r.   )r@   r%   r   r+   s       r   glGetShaderSourceARBr]      sR     *30RSTFz,,V4c40||!!,//r   c                    [        [        U[        5      5      nUc  [        [        U[        5      5      nX$:  a  US:  a  U " XU5      u  pVpx[	        US5      (       a   UR                  5       R                  S5      nON[	        US5      (       a   UR                  5       R                  S5      nO[	        US5      (       a  UR                  nXgU4$ [        SUUS-
  4-  5      e)zKRetrieve the name, size and type of the uniform of the index in the programr   tobytes    tostringr   zIndex %s out of range 0 to %ir#   )
rP   rE   GL_OBJECT_ACTIVE_UNIFORMS_ARB'GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARBhasattrr_   rstripra   r   
IndexError)	r@   programindexbufSize	max_indexr   r(   r   r*   s	            r   glGetActiveUniformARBrk   	  s     -g7TUVI%g/VW
 UaZ#0#I d4##<<>((1DT:&&==?))'2DT7##::D4
'M
	
 r   c                 x    U(       d  [        S5      e[        U5      nUS   [        :w  a	  U[        -   nU " X5      $ )z=Check that name is a string with a null byte at the end of itzNon-null name required)
ValueErrorr/   r.   )r@   rg   r(   s      r   glGetUniformLocationARBro   #  s=     566D>DBx<l"''r   r   )I__doc__r   r   r   r   r   r   rQ   OpenGL.raw.GLr   r	    OpenGL.raw.GL.ARB.shader_objectsr   r   r5   setInputArraySizeglUniform1fvARBglUniform2fvARBglUniform3fvARBglUniform4fvARBglUniform1ivARBglUniform2ivARBglUniform3ivARBglUniform4ivARBglUniformMatrix2fvARBglUniformMatrix3fvARBglUniformMatrix4fvARBglGetObjectParameterfvARB	setOutput_glget_size_mappingrE   rG   rZ   rk   r]   OpenGL._bytesr-   r.   r/   r0   OpenGL.lazywrapperr1   _lazyr2   r3   Constantr4   createExtensionFunctionPLATFORMGLGLhandleARBGLsizeiPOINTERc_char_p
GLintArrayStringLengthsconvsetPyConverterstringArraysetCResolverstringArrayForCsetCConverter
totalCount	NameErrorerrrM   ERROR_CHECKINGGL_OBJECT_COMPILE_STATUS_ARBglCompileShaderARBerrcheckGL_OBJECT_LINK_STATUS_ARBglLinkProgramARBro   r   r   r   <module>r      sS  +X . - &  ) . <8 //"34FFdd  0BBT 0BBT 0BBT 0BBT 0BBT 0BBT 0BBT 0BBT oo&;<NNT  oo&;<NNT  oo&;<NNT  "//*CDNN'--w O   "//*CDNN'--w O   0::=+t ; )$   
  (?@JJt K )	}j$   
 oo&;<FF$ G )
{D  )
d  )
d    __%9:DD$ E )-d     7 7 ! , $!**+CVL 44v'	 	S # & X.OO%&^ ^ ^Hd../\ ] ]# ,	
( 
"-.J"K	 +,E F 
 
 *  * 
 
  2 (  (G  		s   S S(#S(