Skip to content

Commit 1aec9ab

Browse files
committed
BF: fixes to pyglet.gl calls after switch from pyopengl
1 parent 39777a3 commit 1aec9ab

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

psychopy/visual/textbox2/fontmanager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,11 @@ def upload(self):
298298
if self.format == 'alpha':
299299
gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_ALPHA,
300300
self.width, self.height, 0,
301-
gl.GL_ALPHA, gl.GL_UNSIGNED_BYTE, self.data)
301+
gl.GL_ALPHA, gl.GL_UNSIGNED_BYTE, self.data.ctypes)
302302
else:
303303
gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_RGB,
304304
self.width, self.height, 0,
305-
gl.GL_RGB, gl.GL_UNSIGNED_BYTE, self.data)
305+
gl.GL_RGB, gl.GL_UNSIGNED_BYTE, self.data.ctypes)
306306
logging.debug("Upload of Texture Font {} complete"
307307
.format(self.name))
308308

psychopy/visual/textbox2/textbox2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,16 +510,16 @@ def draw(self):
510510
gl.glEnableClientState(gl.GL_TEXTURE_COORD_ARRAY)
511511
gl.glEnableClientState(gl.GL_VERTEX_ARRAY)
512512

513-
gl.glVertexPointer(2, gl.GL_FLOAT, 0, self.verticesPix)
514-
gl.glColorPointer(4, gl.GL_FLOAT, 0, self._colors)
515-
gl.glTexCoordPointer(2, gl.GL_FLOAT, 0, self._texcoords)
513+
gl.glVertexPointer(2, gl.GL_FLOAT, 0, self.verticesPix.ctypes)
514+
gl.glColorPointer(4, gl.GL_FLOAT, 0, self._colors.ctypes)
515+
gl.glTexCoordPointer(2, gl.GL_FLOAT, 0, self._texcoords.ctypes)
516516

517517
self.shader.bind()
518518
self.shader.setInt('texture', 0)
519519
self.shader.setFloat('pixel', [1.0 / 512, 1.0 / 512])
520520
nVerts = len(self.text)*4
521521
gl.glDrawElements(gl.GL_QUADS, nVerts,
522-
gl.GL_UNSIGNED_INT, list(range(nVerts)))
522+
gl.GL_UNSIGNED_INT, np.arange(nVerts, dtype=int).ctypes)
523523
self.shader.unbind()
524524

525525
# removed the colors and font texture

0 commit comments

Comments
 (0)