Skip to content

Commit 09105ee

Browse files
committed
opengl: ensure that GLCAP* are available for __all__ export. thanks cython to make that so clear >_<. closes kivy#321
1 parent aa83ab6 commit 09105ee

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

kivy/graphics/opengl_utils.pyx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ cpdef int gl_has_capability(int cap):
9595
return value
9696

9797
# ok, never been initialized, do it now.
98-
if cap == GLCAP_BGRA:
98+
if cap == c_GLCAP_BGRA:
9999
msg = 'BGRA texture support'
100100
value = gl_has_extension('EXT_bgra')
101101

102-
elif cap == GLCAP_NPOT:
102+
elif cap == c_GLCAP_NPOT:
103103
msg = 'NPOT texture support'
104104
value = gl_has_extension('ARB_texture_non_power_of_two')
105105
if not value:
@@ -108,7 +108,7 @@ cpdef int gl_has_capability(int cap):
108108
# motorola droid don't have OES_ but IMG_
109109
value = gl_has_extension('IMG_texture_npot')
110110

111-
elif cap == GLCAP_S3TC:
111+
elif cap == c_GLCAP_S3TC:
112112
# S3TC support DXT1, DXT3 and DXT5
113113
msg = 'S3TC texture support'
114114
value = gl_has_extension('S3_s3tc')
@@ -117,10 +117,10 @@ cpdef int gl_has_capability(int cap):
117117
if not value:
118118
value = gl_has_extension('OES_texture_compression_s3tc')
119119

120-
elif cap == GLCAP_DXT1:
120+
elif cap == c_GLCAP_DXT1:
121121
# DXT1 is included inside S3TC, but not the inverse.
122122
msg = 'DXT1 texture support'
123-
value = gl_has_capability(GLCAP_S3TC)
123+
value = gl_has_capability(c_GLCAP_S3TC)
124124
if not value:
125125
value = gl_has_extension('EXT_texture_compression_dxt1')
126126

@@ -164,11 +164,11 @@ cpdef int gl_has_texture_native_format(str fmt):
164164
if fmt in ('rgb', 'rgba', 'luminance', 'luminance_alpha'):
165165
return 1
166166
if fmt in ('bgr', 'bgra'):
167-
return gl_has_capability(GLCAP_BGRA)
167+
return gl_has_capability(c_GLCAP_BGRA)
168168
if fmt == 's3tc_dxt1':
169-
return gl_has_capability(GLCAP_DXT1)
169+
return gl_has_capability(c_GLCAP_DXT1)
170170
if fmt.startswith('s3tc_dxt'):
171-
return gl_has_capability(GLCAP_S3TC)
171+
return gl_has_capability(c_GLCAP_S3TC)
172172
return 0
173173

174174

kivy/graphics/opengl_utils_def.pxi

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
cdef int GLCAP_BGRA = 0x0001
2-
cdef int GLCAP_NPOT = 0x0002
3-
cdef int GLCAP_S3TC = 0x0003
4-
cdef int GLCAP_DXT1 = 0x0004
1+
# c definition
2+
cdef int c_GLCAP_BGRA = 0x0001
3+
cdef int c_GLCAP_NPOT = 0x0002
4+
cdef int c_GLCAP_S3TC = 0x0003
5+
cdef int c_GLCAP_DXT1 = 0x0004
6+
7+
# for python export
8+
GLCAP_BGRA = c_GLCAP_NPOT
9+
GLCAP_NPOT = c_GLCAP_NPOT
10+
GLCAP_S3TC = c_GLCAP_S3TC
11+
GLCAP_DXT1 = c_GLCAP_DXT1

0 commit comments

Comments
 (0)