a
    ij                     @   s   d Z ddlmZmZmZ ddlmZmZ ddlZddlm	Z	m
Z
 ddlT ddlmZ dd	 Zeed
dZddlmZ eedddZdS )a  OpenGL extension EXT.draw_buffers

This module customises the behaviour of the 
OpenGL.raw.GLES2.EXT.draw_buffers to provide a more 
Python-friendly API

Overview (from the spec)
	
	This extension increases the number of available framebuffer object
	color attachment points, extends OpenGL ES 2.0 to allow multiple output
	colors, and provides a mechanism for directing those outputs to
	multiple color buffers.
	
	This extension is similar to the combination of the GL_NV_draw_buffers
	and GL_NV_fbo_color_attachments extensions, but imposes certain
	restrictions informed by the OpenGL ES 3.0 API.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/EXT/draw_buffers.txt
    )platformconstantarrays)
extensionswrapperN)_types_glgets)*)_EXTENSION_NAMEc                  C   s   ddl m}  | tS )z=Return boolean indicating whether this extension is availabler   r   )OpenGLr   ZhasGLExtensionr
   r    r   [/home/ghrups/robot-bench/.venv/lib/python3.9/site-packages/OpenGL/GLES2/EXT/draw_buffers.pyglInitDrawBuffersEXT   s    r   bufs)lazyc                 C   s:   |du r|}d}t j|}|du r0t j|}| ||S )zzglDrawBuffers( bufs ) -> bufs

    Wrapper will calculate n from dims of bufs if only
    one argument is provided...
    N)r   ZGLenumArrayZasArrayZ	arraySize)ZbaseOperationnr   r   r   r   glDrawBuffers(   s    r   )NN)__doc__r   r   r   r   r   r   ctypesZOpenGL.raw.GLES2r   r   Z!OpenGL.raw.GLES2.EXT.draw_buffersr
   r   ZglDrawBuffersEXTZsetInputArraySizeZOpenGL.lazywrapperr   Z_lazyr   r   r   r   r   <module>   s   
