comparison pytouhou/lib/opengl.pxd @ 423:d8630c086926

Replace Pyglet with our own Cython OpenGL wrapper.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 16 Jul 2013 21:07:15 +0200
parents
children f4d76d3d6f2a
comparison
equal deleted inserted replaced
422:52829ebe2561 423:d8630c086926
1 # -*- encoding: utf-8 -*-
2 ##
3 ## Copyright (C) 2013 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
4 ##
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published
7 ## by the Free Software Foundation; version 3 only.
8 ##
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
13 ##
14
15 cdef extern from 'GL/gl.h':
16 ctypedef unsigned int GLuint
17 ctypedef int GLint
18 ctypedef float GLfloat
19 ctypedef float GLclampf
20 ctypedef char GLboolean
21 ctypedef char GLchar
22 ctypedef unsigned int GLsizei
23 ctypedef unsigned int GLsizeiptr
24 ctypedef unsigned int GLbitfield
25 ctypedef void GLvoid
26
27 ctypedef enum GLenum:
28 GL_ARRAY_BUFFER
29 GL_STATIC_DRAW
30 GL_DYNAMIC_DRAW
31 GL_UNSIGNED_BYTE
32 GL_UNSIGNED_SHORT
33 GL_INT
34 GL_FLOAT
35 GL_SRC_ALPHA
36 GL_ONE_MINUS_SRC_ALPHA
37 GL_ONE
38 GL_TEXTURE_2D
39 GL_TRIANGLES
40 GL_DEPTH_TEST
41 GL_QUADS
42
43 GL_TEXTURE_MIN_FILTER
44 GL_TEXTURE_MAG_FILTER
45 GL_LINEAR
46 GL_BGRA
47 GL_RGBA
48 GL_RGB
49 GL_LUMINANCE
50 GL_UNSIGNED_SHORT_5_6_5
51 GL_UNSIGNED_SHORT_4_4_4_4_REV
52
53 GL_COLOR_BUFFER_BIT
54 GL_SCISSOR_TEST
55 GL_MODELVIEW
56 GL_FOG
57
58 GL_DEPTH_BUFFER_BIT
59 GL_PROJECTION
60 GL_FOG_MODE
61 GL_FOG_START
62 GL_FOG_END
63 GL_FOG_COLOR
64
65 GL_BLEND
66 GL_PERSPECTIVE_CORRECTION_HINT
67 GL_FOG_HINT
68 GL_NICEST
69 GL_COLOR_ARRAY
70 GL_VERTEX_ARRAY
71 GL_TEXTURE_COORD_ARRAY
72
73 void glVertexPointer(GLint size, GLenum type_, GLsizei stride, GLvoid *pointer)
74 void glTexCoordPointer(GLint size, GLenum type_, GLsizei stride, GLvoid *pointer)
75 void glColorPointer(GLint size, GLenum type_, GLsizei stride, GLvoid *pointer)
76 void glVertexAttribPointer(GLuint index, GLint size, GLenum type_, GLboolean normalized, GLsizei stride, const GLvoid *pointer)
77 void glEnableVertexAttribArray(GLuint index)
78
79 void glBlendFunc(GLenum sfactor, GLenum dfactor)
80 void glDrawArrays(GLenum mode, GLint first, GLsizei count)
81 void glDrawElements(GLenum mode, GLsizei count, GLenum type_, const GLvoid *indices)
82 void glEnable(GLenum cap)
83 void glDisable(GLenum cap)
84
85 void glGenBuffers(GLsizei n, GLuint * buffers)
86 void glDeleteBuffers(GLsizei n, const GLuint * buffers)
87 void glBindBuffer(GLenum target, GLuint buffer_)
88 void glBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
89
90 void glGenTextures(GLsizei n, GLuint *textures)
91 void glBindTexture(GLenum target, GLuint texture)
92 void glTexParameteri(GLenum target, GLenum pname, GLint param)
93 void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format_, GLenum type_, const GLvoid *data)
94
95 void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) #XXX
96 void glClear(GLbitfield mask)
97 void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
98 void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
99 void glMatrixMode(GLenum mode)
100 void glLoadIdentity()
101 void glLoadMatrixf(const GLfloat * m)
102
103 void glFogi(GLenum pname, GLint param)
104 void glFogf(GLenum pname, GLfloat param)
105 void glFogfv(GLenum pname, const GLfloat * params)
106
107 void glHint(GLenum target, GLenum mode)
108 void glEnableClientState(GLenum cap)