
    3j                     $   S r SSKrSSKJrJrJrJrJrJr  SSK	J
r
   " S S\5      r " S S\5      r " S	 S
\\5      r\\La   " S S\\5      rO\r " S S\\5      r " S S\\5      r\S:X  a  \" SS5      r\" SS5      r\" SS5      rSSKr\\\4 Hw  r\R4                  " \R6                  " \5      5      r\\:X  d   \" \5      \" \5      45       e\R<                  \R<                  :X  a  M\   \R<                  \R<                  45       e   gg)z)Implementation of OpenGL constant objects    N)bytesunicodeas_8_bitlonginteger_typesmaxsize)_configflagsc                   B   ^  \ rS rSrSrSU 4S jjrS rU 4S jrSrU =r	$ )Constant   a4  OpenGL constant that displays itself as a name rather than a value

The purpose of this class is to make debugging OpenGL code easier,
as you recieve messages that say what value you passed in in a
human-readable form, rather than as a bald number that requires
lookup and disambiguation in the header file.
c                 &  > [        U[        5      (       d  [        U[        5      (       a  U [        La  [        X5      $ [        U[        5      (       a  U [
        La  [        X5      $ [        U[        5      (       a  U [        La  [        X5      $ [        U[        [        45      (       a  U [        La  [        U[        U5      5      $ [        U[        5      (       a  U[        :  a
  U[        -  * n[        [        U ]?  X5      nXl        ["        R$                  (       ao  [&        R(                  " 5       R*                  nU(       aI  UR*                  (       a8  SUR*                  R,                  ;   a  UR*                  R,                  S   Ul        U$ )z5Initialise the constant with the given name and value__name__)
isinstancer   floatFloatConstantintIntConstantr   LongConstantr   r   StringConstantr   r   r   super__new__namer	   MODULE_ANNOTATIONSsys	_getframef_back	f_globals
__module__)clsr   valuebaseframe	__class__s        I/home/wildlama/miniconda3/lib/python3.13/site-packages/OpenGL/constant.pyr   Constant.__new__   s   5(,,5%))c.F$d33UC))c.D"D11UD**s,/F#T22UU7O55#^:S%tXe_>>um--w 7?+Xc*C8	**MMO**E*8N8N*N"',,"8"8"D    c                     U R                   $ )z+Return the name, rather than the bald valuer   selfs    r$   __repr__Constant.__repr__#       yyr&   c                 D   > U R                   4[        [        U ]  5       -   $ )z5Produce the new arguments for recreating the instance)r   r   r   __getnewargs__r*   r#   s    r$   r/   Constant.__getnewargs__&   s    		|eXtDFFFr&    N)
r   r   __qualname____firstlineno____doc__r   r+   r/   __static_attributes____classcell__r#   s   @r$   r   r      s    *G Gr&   r   c                   8   ^  \ rS rSrSrU 4S jrS rS rSrU =r	$ )NumericConstant*   z&Base class for numeric-value constantsc                 L   > U R                   < S[        [        U ]  5       < S3$ z+Return the value as a human-friendly stringz ()r   r   r   __str__r0   s    r$   rA   NumericConstant.__str__,       ))E(4$@$BCCr&   c                     U R                   $ )z&Retrieve state for pickle and the liker(   r)   s    r$   __getstate__NumericConstant.__getstate__/   r-   r&   c                     Xl         g r3   r(   )r*   states     r$   __setstate__NumericConstant.__setstate__2   s    	r&   r(   )
r   r   r4   r5   r6   rA   rE   rI   r7   r8   r9   s   @r$   r;   r;   *   s    0D r&   r;   c                       \ rS rSrSrSrg)r   5   zInteger constantr2   Nr   r   r4   r5   r6   r7   r2   r&   r$   r   r   5   s    r&   r   c                       \ rS rSrSrSrg)r   8   zLong integer constantr2   NrM   r2   r&   r$   r   r   8   s    #r&   r   c                       \ rS rSrSrSrg)r   <   zFloat constantr2   NrM   r2   r&   r$   r   r   <   s    r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   ?   zString constantsc                 L   > U R                   < S[        [        U ]  5       < S3$ r>   r@   r0   s    r$   r+   StringConstant.__repr__A   rC   r&   r2   )r   r   r4   r5   r6   r+   r7   r8   r9   s   @r$   r   r   ?   s    D Dr&   r   __main__testint   	testfloatg      @teststrzsome testing string)r6   r   OpenGL._bytesr   r   r   r   r   r   OpenGLr	   objectr   r;   r   r   r   r   r   r   r   xyzpicklevalloadsdumpsrestoredstrr   r2   r&   r$   <module>rg      s   / 
 N N "G "GH	x 	?C d?$ $ L_e Dh D zY#A{C)A	#8:A1u<<s!4538Xs3x 88}}(B8==*BB(  r&   