(self, pixmap, viewport_shape)
Renders the pixmap on a fullscreen quad.

    Args:
      pixmap: A 3D numpy array of bytes (np.uint8), with dimensions
        (width, height, 3).
      viewport_shape: A tuple of two elements, (width, height).
Renders the pixmap on a fullscreen quad.
Renders the pixmap on a fullscreen quad .
def render(self, pixmap, viewport_shape):
    """Renders the pixmap on a fullscreen quad.

    Args:
      pixmap: A 3D numpy array of bytes (np.uint8), with dimensions
        (width, height, 3).
      viewport_shape: A tuple of two elements, (width, height).
    """
    GL.glClear(GL.GL_COLOR_BUFFER_BIT)
    GL.glViewport(0, 0, *viewport_shape)
    GL.glUseProgram(self._shader)
    GL.glActiveTexture(GL.GL_TEXTURE0)
    GL.glBindTexture(GL.GL_TEXTURE_2D, self._texture)
    GL.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1)
    GL.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB, pixmap.shape[1],
                    pixmap.shape[0], 0, GL.GL_RGB, GL.GL_UNSIGNED_BYTE,
                    pixmap)
    GL.glUniform1i(self._var_texture_sampler, 0)
    GL.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4)
def render ( self , pixmap , viewport_shape ) : GL . glClear ( GL . GL_COLOR_BUFFER_BIT ) GL . glViewport ( 0 , 0 , * viewport_shape ) GL . glUseProgram ( self . _shader ) GL . glActiveTexture ( GL . GL_TEXTURE0 ) GL . glBindTexture ( GL . GL_TEXTURE_2D , self . _texture ) GL . glPixelStorei ( GL . GL_UNPACK_ALIGNMENT , 1 ) GL . glTexImage2D ( GL . GL_TEXTURE_2D , 0 , GL . GL_RGB , pixmap . shape [ 1 ] , pixmap . shape [ 0 ] , 0 , GL . GL_RGB , GL . GL_UNSIGNED_BYTE , pixmap ) GL . glUniform1i ( self . _var_texture_sampler , 0 ) GL . glDrawArrays ( GL . GL_TRIANGLE_STRIP , 0 , 4 )