Mercurial > touhou
annotate pytouhou/lib/opengl.pxd @ 583:47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 05 Oct 2014 20:38:06 +0200 |
parents | b8df946d394d |
children | 538b52aafbca |
rev | line source |
---|---|
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 # -*- encoding: utf-8 -*- |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
2 ## |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
3 ## Copyright (C) 2013 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 ## |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 ## This program is free software; you can redistribute it and/or modify |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 ## it under the terms of the GNU General Public License as published |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 ## by the Free Software Foundation; version 3 only. |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 ## |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
9 ## This program is distributed in the hope that it will be useful, |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 ## GNU General Public License for more details. |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
13 ## |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
14 |
450
2a352118c55a
Add back Windows support, using GLEW for OpenGL.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
426
diff
changeset
|
15 |
555
98380e4a0ee5
Switch to libepoxy instead of libGLEW, which will help with OpenGL portability.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
519
diff
changeset
|
16 cdef extern from 'epoxy/gl.h' nogil: |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
17 ctypedef unsigned int GLuint |
519
b18f0bd30ad0
Optimise background rendering.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
518
diff
changeset
|
18 ctypedef unsigned short GLushort |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
19 ctypedef int GLint |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
20 ctypedef float GLfloat |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
21 ctypedef float GLclampf |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
22 ctypedef char GLboolean |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
23 ctypedef char GLchar |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
24 ctypedef unsigned int GLsizei |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
25 ctypedef unsigned int GLsizeiptr |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
26 ctypedef unsigned int GLbitfield |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
27 ctypedef void GLvoid |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
28 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
29 ctypedef enum GLenum: |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
30 GL_ARRAY_BUFFER |
519
b18f0bd30ad0
Optimise background rendering.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
518
diff
changeset
|
31 GL_ELEMENT_ARRAY_BUFFER |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
32 GL_STATIC_DRAW |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
33 GL_DYNAMIC_DRAW |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
34 GL_UNSIGNED_BYTE |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
35 GL_UNSIGNED_SHORT |
518
75ae628522c9
Use shorts instead of ints for vertex position, reducing the size of a vertex to 20 bytes from 24.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
491
diff
changeset
|
36 GL_SHORT |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
37 GL_FLOAT |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
38 GL_SRC_ALPHA |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
39 GL_ONE_MINUS_SRC_ALPHA |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
40 GL_ONE |
462
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
41 GL_ZERO |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
42 GL_TEXTURE_2D |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
43 GL_TRIANGLES |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
44 GL_DEPTH_TEST |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
45 GL_QUADS |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
46 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
47 GL_TEXTURE_MIN_FILTER |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
48 GL_TEXTURE_MAG_FILTER |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
49 GL_LINEAR |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
50 GL_BGRA |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
51 GL_RGBA |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
52 GL_RGB |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
53 GL_LUMINANCE |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
54 GL_UNSIGNED_SHORT_5_6_5 |
559
1be60813f7cb
Get OpenGL ES 2.0 to work thanks to libepoxy. PCB textures will need swizzle in the shaders since BGRA isn’t natively supported on GLES.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
558
diff
changeset
|
55 GL_UNSIGNED_SHORT_4_4_4_4 |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
56 GL_UNSIGNED_SHORT_4_4_4_4_REV |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
57 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
58 GL_COLOR_BUFFER_BIT |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
59 GL_SCISSOR_TEST |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
60 GL_MODELVIEW |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
61 GL_FOG |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
62 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
63 GL_DEPTH_BUFFER_BIT |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
64 GL_PROJECTION |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
65 GL_FOG_MODE |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
66 GL_FOG_START |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
67 GL_FOG_END |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
68 GL_FOG_COLOR |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
69 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
70 GL_BLEND |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
71 GL_PERSPECTIVE_CORRECTION_HINT |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
72 GL_FOG_HINT |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
73 GL_NICEST |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
74 GL_COLOR_ARRAY |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
75 GL_VERTEX_ARRAY |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
76 GL_TEXTURE_COORD_ARRAY |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
77 |
424
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
78 GL_VERTEX_SHADER |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
79 GL_FRAGMENT_SHADER |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
80 GL_INFO_LOG_LENGTH |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
81 GL_COMPILE_STATUS |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
82 GL_LINK_STATUS |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
83 |
462
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
84 GL_FRAMEBUFFER |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
85 GL_COLOR_ATTACHMENT0 |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
86 GL_RENDERBUFFER |
559
1be60813f7cb
Get OpenGL ES 2.0 to work thanks to libepoxy. PCB textures will need swizzle in the shaders since BGRA isn’t natively supported on GLES.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
558
diff
changeset
|
87 GL_DEPTH_COMPONENT16 |
462
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
88 GL_DEPTH_ATTACHMENT |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
89 GL_FRAMEBUFFER_COMPLETE |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
90 |
579
b8df946d394d
Add grouping for OpenGL calls, making traces much more readable.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
559
diff
changeset
|
91 # Debug |
b8df946d394d
Add grouping for OpenGL calls, making traces much more readable.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
559
diff
changeset
|
92 |
b8df946d394d
Add grouping for OpenGL calls, making traces much more readable.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
559
diff
changeset
|
93 GL_DEBUG_SOURCE_APPLICATION |
b8df946d394d
Add grouping for OpenGL calls, making traces much more readable.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
559
diff
changeset
|
94 |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
95 void glVertexPointer(GLint size, GLenum type_, GLsizei stride, GLvoid *pointer) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
96 void glTexCoordPointer(GLint size, GLenum type_, GLsizei stride, GLvoid *pointer) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
97 void glColorPointer(GLint size, GLenum type_, GLsizei stride, GLvoid *pointer) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
98 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
99 void glBlendFunc(GLenum sfactor, GLenum dfactor) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
100 void glDrawArrays(GLenum mode, GLint first, GLsizei count) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
101 void glDrawElements(GLenum mode, GLsizei count, GLenum type_, const GLvoid *indices) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
102 void glEnable(GLenum cap) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
103 void glDisable(GLenum cap) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
104 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
105 void glGenTextures(GLsizei n, GLuint *textures) |
426
5d7bb2fd74f7
Never keep texture on the host when it has been uploaded, and prevent them from being decoded again.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
424
diff
changeset
|
106 void glDeleteTextures(GLsizei n, const GLuint *textures) |
423
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
107 void glBindTexture(GLenum target, GLuint texture) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
108 void glTexParameteri(GLenum target, GLenum pname, GLint param) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
109 void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format_, GLenum type_, const GLvoid *data) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
110 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
111 void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) #XXX |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
112 void glClear(GLbitfield mask) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
113 void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
114 void glScissor(GLint x, GLint y, GLsizei width, GLsizei height) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
115 void glMatrixMode(GLenum mode) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
116 void glLoadIdentity() |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
117 void glLoadMatrixf(const GLfloat * m) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
118 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
119 void glFogi(GLenum pname, GLint param) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
120 void glFogf(GLenum pname, GLfloat param) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
121 void glFogfv(GLenum pname, const GLfloat * params) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
122 |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
123 void glHint(GLenum target, GLenum mode) |
d8630c086926
Replace Pyglet with our own Cython OpenGL wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
124 void glEnableClientState(GLenum cap) |
424
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
125 |
555
98380e4a0ee5
Switch to libepoxy instead of libGLEW, which will help with OpenGL portability.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
519
diff
changeset
|
126 # Here start non-1.x declarations. |
491
2276229282fd
Fix gcc’s warnings with -Wall -Wextra.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
462
diff
changeset
|
127 |
2276229282fd
Fix gcc’s warnings with -Wall -Wextra.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
462
diff
changeset
|
128 void glVertexAttribPointer(GLuint index, GLint size, GLenum type_, GLboolean normalized, GLsizei stride, const GLvoid *pointer) |
2276229282fd
Fix gcc’s warnings with -Wall -Wextra.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
462
diff
changeset
|
129 void glEnableVertexAttribArray(GLuint index) |
2276229282fd
Fix gcc’s warnings with -Wall -Wextra.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
462
diff
changeset
|
130 |
2276229282fd
Fix gcc’s warnings with -Wall -Wextra.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
462
diff
changeset
|
131 void glGenBuffers(GLsizei n, GLuint * buffers) |
2276229282fd
Fix gcc’s warnings with -Wall -Wextra.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
462
diff
changeset
|
132 void glDeleteBuffers(GLsizei n, const GLuint * buffers) |
2276229282fd
Fix gcc’s warnings with -Wall -Wextra.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
462
diff
changeset
|
133 void glBindBuffer(GLenum target, GLuint buffer_) |
2276229282fd
Fix gcc’s warnings with -Wall -Wextra.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
462
diff
changeset
|
134 void glBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) |
2276229282fd
Fix gcc’s warnings with -Wall -Wextra.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
462
diff
changeset
|
135 |
424
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
136 GLuint glCreateProgram() |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
137 GLuint glCreateShader(GLenum shaderType) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
138 void glLinkProgram(GLuint program) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
139 void glUseProgram(GLuint program) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
140 void glGetProgramiv(GLuint program, GLenum pname, GLint *params) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
141 void glGetProgramInfoLog(GLuint program, GLsizei maxLength, GLsizei *length, GLchar *infoLog) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
142 |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
143 void glShaderSource(GLuint shader, GLsizei count, const GLchar **string, const GLint *length) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
144 void glCompileShader(GLuint shader) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
145 void glGetShaderiv(GLuint shader, GLenum pname, GLint *params) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
146 void glGetShaderInfoLog(GLuint shader, GLsizei maxLength, GLsizei *length, GLchar *infoLog) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
147 void glAttachShader(GLuint program, GLuint shader) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
148 |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
149 GLint glGetUniformLocation(GLuint program, const GLchar *name) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
150 void glBindAttribLocation(GLuint program, GLuint index, const GLchar *name) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
151 void glUniform1fv(GLint location, GLsizei count, const GLfloat *value) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
152 void glUniform4fv(GLint location, GLsizei count, const GLfloat *value) |
f4d76d3d6f2a
Make the Shader class use cython too.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
423
diff
changeset
|
153 void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
462
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
154 |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
155 void glGenFramebuffers(GLsizei n, GLuint *ids) |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
156 void glBindFramebuffer(GLenum target, GLuint framebuffer) |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
157 void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
158 void glGenRenderbuffers(GLsizei n, GLuint *renderbuffers) |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
159 void glBindRenderbuffer(GLenum target, GLuint renderbuffer) |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
160 void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
161 void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) |
a71b912b45b7
Render to framebuffers first, and reposition some interface elements in the game area.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
162 GLenum glCheckFramebufferStatus(GLenum target) |
558
94725968dabb
Use vertex array objects, to be compatible with OpenGL 3.1+ core profile.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
163 |
94725968dabb
Use vertex array objects, to be compatible with OpenGL 3.1+ core profile.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
164 void glGenVertexArrays(GLsizei n, GLuint *arrays) |
94725968dabb
Use vertex array objects, to be compatible with OpenGL 3.1+ core profile.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
165 void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) |
94725968dabb
Use vertex array objects, to be compatible with OpenGL 3.1+ core profile.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
555
diff
changeset
|
166 void glBindVertexArray(GLuint array) |
579
b8df946d394d
Add grouping for OpenGL calls, making traces much more readable.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
559
diff
changeset
|
167 |
b8df946d394d
Add grouping for OpenGL calls, making traces much more readable.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
559
diff
changeset
|
168 # Debug |
b8df946d394d
Add grouping for OpenGL calls, making traces much more readable.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
559
diff
changeset
|
169 |
b8df946d394d
Add grouping for OpenGL calls, making traces much more readable.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
559
diff
changeset
|
170 void glPushDebugGroup(GLenum source, GLuint id_, GLsizei length, const char *message) |
b8df946d394d
Add grouping for OpenGL calls, making traces much more readable.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
559
diff
changeset
|
171 void glPopDebugGroup() |
583
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
172 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
173 # Non-OpenGL libepoxy functions. |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
174 |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
175 int epoxy_gl_version() |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
176 bint epoxy_has_gl_extension(const char *extension) |
47cf4e3d159d
Use libepoxy to discover the actual GL version we are using, and available extensions.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
579
diff
changeset
|
177 bint epoxy_is_desktop_gl() |