# pybiklib/gl.pxd
# generated with: ./tools/create-gl-pxd.py gl pybiklib/gl.pxd pybiklib/glarea.py pybiklib/gldraw.py pybiklib/gl.pxd

from libc.stddef cimport ptrdiff_t
from libc.stdint cimport int32_t, intptr_t, int8_t, uint8_t


# from /usr/include/GL/gl.h:

cdef extern from 'GL/gl.h':
    enum: GL_FALSE
    enum: GL_TRUE
    enum: GL_UNSIGNED_BYTE
    enum: GL_FLOAT
    enum: GL_POINTS
    enum: GL_LINES
    enum: GL_TRIANGLES
    enum: GL_CCW
    enum: GL_BACK
    enum: GL_CULL_FACE
    enum: GL_DEPTH_TEST
    enum: GL_RGB
    enum: GL_RGBA
    enum: GL_TEXTURE_2D
    enum: GL_VENDOR
    enum: GL_RENDERER
    enum: GL_VERSION
    enum: GL_EXTENSIONS
    enum: GL_DEPTH_BUFFER_BIT
    enum: GL_COLOR_BUFFER_BIT
    enum: GL_MULTISAMPLE
    enum: GL_SAMPLE_ALPHA_TO_COVERAGE
    enum: GL_SAMPLE_ALPHA_TO_ONE
    enum: GL_SAMPLE_COVERAGE
    enum: GL_SAMPLE_BUFFERS
    enum: GL_SAMPLES
    enum: GL_SAMPLE_COVERAGE_VALUE
    enum: GL_SAMPLE_COVERAGE_INVERT


# from /usr/include/GL/glext.h:

cdef extern from 'GL/glext.h':
    enum: GL_ARRAY_BUFFER
    enum: GL_STATIC_DRAW
    enum: GL_MAX_VERTEX_ATTRIBS
    enum: GL_FRAGMENT_SHADER
    enum: GL_VERTEX_SHADER
    enum: GL_DELETE_STATUS
    enum: GL_COMPILE_STATUS
    enum: GL_LINK_STATUS
    enum: GL_VALIDATE_STATUS
    enum: GL_INFO_LOG_LENGTH
    enum: GL_ATTACHED_SHADERS
    enum: GL_ACTIVE_UNIFORMS
    enum: GL_ACTIVE_UNIFORM_MAX_LENGTH
    enum: GL_ACTIVE_ATTRIBUTES
    enum: GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
    enum: GL_SHADING_LANGUAGE_VERSION


# from /usr/include/GL/gl.h:

ctypedef unsigned int	GLenum
ctypedef unsigned char	GLboolean
ctypedef unsigned int	GLbitfield
ctypedef void		GLvoid
ctypedef int		GLint
ctypedef unsigned char	GLubyte
ctypedef unsigned int	GLuint
ctypedef int		GLsizei
ctypedef float		GLfloat
ctypedef float		GLclampf


# from /usr/include/GL/glext.h:

ctypedef ptrdiff_t GLsizeiptr
ctypedef ptrdiff_t GLintptr
ctypedef char GLchar


cdef extern from *:
    ctypedef GLchar* const_GLchar_ptr "const GLchar*"


# from /usr/include/GL/gl.h with:

cdef extern from 'GL/gl.h':
    cdef void  glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
    cdef void  glClear( GLbitfield mask )
    cdef void  glCullFace( GLenum mode )
    cdef void  glFrontFace( GLenum mode )
    cdef void  glEnable( GLenum cap )
    cdef void  glDisable( GLenum cap )
    cdef GLboolean  glIsEnabled( GLenum cap )
    cdef void  glGetBooleanv( GLenum pname, GLboolean *params )
    cdef void  glGetFloatv( GLenum pname, GLfloat *params )
    cdef void  glGetIntegerv( GLenum pname, GLint *params )
    cdef GLubyte *  glGetString( GLenum name )
    cdef void  glViewport( GLint x, GLint y,
                                    GLsizei width, GLsizei height )
    cdef void  glDrawArrays( GLenum mode, GLint first, GLsizei count )
    cdef void  glReadPixels( GLint x, GLint y,
                                    GLsizei width, GLsizei height,
                                    GLenum format, GLenum type,
                                    GLvoid *pixels )
    cdef void  glTexSubImage2D( GLenum target, GLint level,
                                       GLint xoffset, GLint yoffset,
                                       GLsizei width, GLsizei height,
                                       GLenum format, GLenum type,
                                       GLvoid *pixels )
    cdef void  glActiveTexture( GLenum texture )


# from /usr/include/GL/glext.h with:

cdef extern from 'GL/glext.h':
    cdef void  glBindBuffer (GLenum target, GLuint buffer)
    cdef void  glDeleteBuffers (GLsizei n, GLuint *buffers)
    cdef void  glGenBuffers (GLsizei n, GLuint *buffers)
    cdef void  glBufferData (GLenum target, GLsizeiptr size, void *data, GLenum usage)
    cdef void  glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void *data)
    cdef void  glAttachShader (GLuint program, GLuint shader)
    cdef void  glBindAttribLocation (GLuint program, GLuint index, GLchar *name)
    cdef void  glCompileShader (GLuint shader)
    cdef GLuint  glCreateProgram ()
    cdef GLuint  glCreateShader (GLenum type)
    cdef void  glDeleteProgram (GLuint program)
    cdef void  glDeleteShader (GLuint shader)
    cdef void  glDetachShader (GLuint program, GLuint shader)
    cdef void  glEnableVertexAttribArray (GLuint index)
    cdef void  glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
    cdef void  glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
    cdef GLint  glGetAttribLocation (GLuint program, GLchar *name)
    cdef void  glGetProgramiv (GLuint program, GLenum pname, GLint *params)
    cdef void  glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
    cdef void  glGetShaderiv (GLuint shader, GLenum pname, GLint *params)
    cdef void  glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
    cdef GLint  glGetUniformLocation (GLuint program, GLchar *name)
    cdef void  glLinkProgram (GLuint program)
    cdef void  glShaderSource (GLuint shader, GLsizei count, GLchar **string, GLint *length)
    cdef void  glUseProgram (GLuint program)
    cdef void  glUniform1i (GLint location, GLint v0)
    cdef void  glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, GLfloat *value)
    cdef void  glValidateProgram (GLuint program)
    cdef void  glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void *pointer)

# GL version 2.0 needed

