
    kj
                         d dl mZ d dlZd dlZd dlmZ d dlmZ edddfdee         de	de	d	ee
         d
ef
dZddddedfdeeef         deeef         de	de	dee         d	ee
         d
efdZdS )    )OptionalN)AttributeNames)VAOT
attr_namesnormalsuvsnamereturnc                 *    t          d||| |          S )a  
    Creates a screen aligned quad using two triangles with normals and texture coordinates.

    Keyword Args:
        attr_names (AttributeNames): Attrib name config
        normals (bool): Include normals in VAO
        uvs (bool): Include texture coordinates in VAO
        name (str): Optional name for the VAO
    Returns:
        A :py:class:`~moderngl_window.opengl.vao.VAO` instance.
    )       @r   )sizer   r   r   r	   )quad_2d)r   r   r   r	   s       X/home/agentuser/manim-venv/lib/python3.11/site-packages/moderngl_window/geometry/quad.pyquad_fsr   
   s*    "        )      ?r   )        r   r   posc                    | \  }}|\  }}	t          j        ||dz  z
  |	|dz  z   d||dz  z
  |	|dz  z
  d||dz  z   |	|dz  z
  d||dz  z
  |	|dz  z   d||dz  z   |	|dz  z
  d||dz  z   |	|dz  z   dgt           j                  }
t          j        g dt           j                  }t          j        g dt           j                  }t          |pdt          j                  }|                    |
d|j        g           |r|                    |d|j        g           |r|                    |d	|j	        g           |S )
a  
    Creates a 2D quad VAO using 2 triangles with normals and texture coordinates.

    Keyword Args:
        size (tuple): width and height
        pos (float): Center position x and y
        normals (bool): Include normals in VAO
        uvs (bool): Include texture coordinates in VAO
        attr_names (AttributeNames): Attrib name config
        name (str): Optional name for the VAO
    Returns:
        A :py:class:`~moderngl_window.opengl.vao.VAO` instance.
    r   r   )dtype)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   zgeometry:quad)mode3f2f)
numpyarrayfloat32r   moderngl	TRIANGLESbufferPOSITIONNORMAL
TEXCOORD_0)r   r   r   r   r   r	   widthheightxposypospos_datanormal_datauv_datavaos                 r   r   r   $   s   * ME6JD$ {us{D6C</us{D6C</us{D6C</us{D6C</us{D6C</us{D6C</ ]  H +    ]  K k    ]  G d%oH,>
?
?
?CJJx
 34555 ;

;z'8&9:::
 ;

7D:#8"9:::Jr   )typingr   r   r   #moderngl_window.geometry.attributesr   moderngl_window.opengl.vaor   typeboolstrr   tuplefloatr    r   r   <module>r4      s?           > > > > > > * * * * * * (6	 ^$ 
 3-	
 	   6 !+)'5< <
u
<	ue|	< < 
	<
 ^$< 3-< 	< < < < < <r   