old_contents: from pynodegl import TexturedShape, Quad, Triangle, Shape, ShapePrimitive, Texture, Media, Shader
  
  from pynodegl_utils.misc import scene
  
  from OpenGL import GL
  
  @scene()
  def centered_media(cfg):
      q = Quad((-0.5, -0.5, 0), (1, 0, 0), (0, 1, 0))
      m = Media(cfg.media_filename)
      t = Texture(data_src=m)
      s = Shader()
      tshape = TexturedShape(q, s, t)
      return tshape
  
  @scene()
  def centered_triangle_media(cfg):
      q = Triangle((-0.5, -0.5, 0), (-0.5, 0.5, 0), (0.5, -0.5, 0))
      m = Media(cfg.media_filename)
      t = Texture(data_src=m)
      s = Shader()
      tshape = TexturedShape(q, s, t)
      return tshape
  
  @scene({'name': 'n', 'type': 'range', 'range': [0,1], 'unit_base': 1000})
  def centered_shape_media(cfg, n=0.5):
  
      q = Shape([
          ShapePrimitive((  -n, -n/2, 0), (1, 0)),
          ShapePrimitive((  -n,  n/2, 0), (0, 0)),
          ShapePrimitive((-n/2,    n, 0), (1, 1)),
          ShapePrimitive(( n/2,    n, 0), (1, 0)),
          ShapePrimitive((   n,  n/2, 0), (0, 0)),
          ShapePrimitive((   n, -n/2, 0), (1, 1)),
          ShapePrimitive(( n/2,   -n, 0), (1, 1)),
          ShapePrimitive((-n/2,   -n, 0), (1, 1)),
      ])
      q.set_draw_mode(GL.GL_POLYGON)
  
      m = Media(cfg.media_filename)
      t = Texture(data_src=m)
      s = Shader()
      tshape = TexturedShape(q, s, t)
      return tshape
  
new_contents: from pynodegl import TexturedShape, Quad, Triangle, Shape, ShapePrimitive, Texture, Media, Shader
  
  from pynodegl_utils.misc import scene
  
  from OpenGL import GL
  
  @scene()
  def centered_media(cfg):
      q = Quad((-0.5, -0.5, 0), (1, 0, 0), (0, 1, 0))
      m = Media(cfg.media_filename)
      t = Texture(data_src=m)
      s = Shader()
      tshape = TexturedShape(q, s, t)
      return tshape
  
  @scene()
  def centered_triangle_media(cfg):
      q = Triangle((-0.5, -0.5, 0), (-0.5, 0.5, 0), (0.5, -0.5, 0))
      m = Media(cfg.media_filename)
      t = Texture(data_src=m)
      s = Shader()
      tshape = TexturedShape(q, s, t)
      return tshape
  
  @scene({'name': 'n', 'type': 'range', 'range': [0,1], 'unit_base': 1000})
  def centered_shape_media(cfg, n=0.5):
  
      q = Shape([
          ShapePrimitive((  -n, -n/2, 0), (0,    0.75)),
          ShapePrimitive((  -n,  n/2, 0), (0,    0.25)),
          ShapePrimitive((-n/2,    n, 0), (0.25, 0)),
          ShapePrimitive(( n/2,    n, 0), (0.75, 0)),
          ShapePrimitive((   n,  n/2, 0), (1,    0.25)),
          ShapePrimitive((   n, -n/2, 0), (1,    0.75)),
          ShapePrimitive(( n/2,   -n, 0), (0.75, 1)),
          ShapePrimitive((-n/2,   -n, 0), (0.25, 1)),
      ])
      q.set_draw_mode(GL.GL_POLYGON)
  
      m = Media(cfg.media_filename)
      t = Texture(data_src=m)
      s = Shader()
      tshape = TexturedShape(q, s, t)
      return tshape
  
subject: improve media texture coordinates mapping