Hi,

If anyone can help me with the following error, it would be
appreciated.  Really, for now, I'd just like to be able to set
arbitrary pixels to arbitrary colours so I can render something, so
alternatively pointers to existing example code to do that would be
welcomed.

The following code:

  import array
  data = array.array('B', (0 for x in xrange(w.width * w.height * 3)))

  mapImage = pyglet.image.create(w.width, w.height)
  mapImage.set_data('RGB', w.width * 3, data)

  ...

  w.clear()
  mapImage.blit(0, 0)

Results in the following error:

Traceback (most recent call last):
  File "map.py", line 167, in <module>
    mapImage.blit(0, 0)
  File "c:\Python26\lib\site-packages\pyglet\image\__init__.py", line
854, in blit
    self.get_texture().blit(x, y, z, width, height)
  File "c:\Python26\lib\site-packages\pyglet\image\__init__.py", line
780, in get_texture
    self._current_texture = self.create_texture(Texture, rectangle)
  File "c:\Python26\lib\site-packages\pyglet\image\__init__.py", line
774, in create_texture
    self.anchor_x, self.anchor_y, 0, None)
  File "c:\Python26\lib\site-packages\pyglet\image\__init__.py", line
915, in blit_to_texture
    data = self._convert(data_format, data_pitch)
  File "c:\Python26\lib\site-packages\pyglet\image\__init__.py", line
968, in _convert
    self._ensure_string_data()
  File "c:\Python26\lib\site-packages\pyglet\image\__init__.py", line
1035, in _ensure_string_data
    memmove(buf, self._current_data, len(self._current_data))
ctypes.ArgumentError: argument 2: <type 'exceptions.TypeError'>: wrong
type

Something obvious?

Cheers,
Richard.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to