We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39777a3 commit 1aec9abCopy full SHA for 1aec9ab
psychopy/visual/textbox2/fontmanager.py
@@ -298,11 +298,11 @@ def upload(self):
298
if self.format == 'alpha':
299
gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_ALPHA,
300
self.width, self.height, 0,
301
- gl.GL_ALPHA, gl.GL_UNSIGNED_BYTE, self.data)
+ gl.GL_ALPHA, gl.GL_UNSIGNED_BYTE, self.data.ctypes)
302
else:
303
gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_RGB,
304
305
- gl.GL_RGB, gl.GL_UNSIGNED_BYTE, self.data)
+ gl.GL_RGB, gl.GL_UNSIGNED_BYTE, self.data.ctypes)
306
logging.debug("Upload of Texture Font {} complete"
307
.format(self.name))
308
psychopy/visual/textbox2/textbox2.py
@@ -510,16 +510,16 @@ def draw(self):
510
gl.glEnableClientState(gl.GL_TEXTURE_COORD_ARRAY)
511
gl.glEnableClientState(gl.GL_VERTEX_ARRAY)
512
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)
+ gl.glVertexPointer(2, gl.GL_FLOAT, 0, self.verticesPix.ctypes)
+ gl.glColorPointer(4, gl.GL_FLOAT, 0, self._colors.ctypes)
+ gl.glTexCoordPointer(2, gl.GL_FLOAT, 0, self._texcoords.ctypes)
516
517
self.shader.bind()
518
self.shader.setInt('texture', 0)
519
self.shader.setFloat('pixel', [1.0 / 512, 1.0 / 512])
520
nVerts = len(self.text)*4
521
gl.glDrawElements(gl.GL_QUADS, nVerts,
522
- gl.GL_UNSIGNED_INT, list(range(nVerts)))
+ gl.GL_UNSIGNED_INT, np.arange(nVerts, dtype=int).ctypes)
523
self.shader.unbind()
524
525
# removed the colors and font texture
0 commit comments