I think I get the same border error on my GeForce 8600 GTS.
Incidentally, I ran the python -m pyglet.info command and got various
errors:

Hmm, should that be the x84_64 ... I'm running 32 bit...?

Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/pyglet/info.py", line 173, in _try_dump
  File "build/bdist.linux-x86_64/egg/pyglet/info.py", line 77, in dump_window
  File "build/bdist.linux-x86_64/egg/pyglet/window/__init__.py", line
1667, in <module>
  File "build/bdist.linux-x86_64/egg/pyglet/gl/__init__.py", line 388,
in _create_shadow_window
  File "build/bdist.linux-x86_64/egg/pyglet/window/xlib/__init__.py",
line 471, in __init__
  File "build/bdist.linux-x86_64/egg/pyglet/window/__init__.py", line
671, in __init__
  File "build/bdist.linux-x86_64/egg/pyglet/window/xlib/__init__.py",
line 637, in _create
  File "build/bdist.linux-x86_64/egg/pyglet/window/xlib/__init__.py",
line 782, in set_caption
  File "build/bdist.linux-x86_64/egg/pyglet/window/xlib/__init__.py",
line 1029, in _set_text_property
AttributeError: 'NoneType' object has no attribute 'encode'
/usr/lib/python2.5/site-packages/pyglet-1.1beta1-py2.5.egg/pyglet/gl/gl_info.py:134:
UserWarning: No GL context created yet.
/usr/lib/python2.5/site-packages/pyglet-1.1beta1-py2.5.egg/pyglet/gl/gl_info.py:175:
UserWarning: No GL context created yet.
/usr/lib/python2.5/site-packages/pyglet-1.1beta1-py2.5.egg/pyglet/gl/gl_info.py:166:
UserWarning: No GL context created yet.
/usr/lib/python2.5/site-packages/pyglet-1.1beta1-py2.5.egg/pyglet/gl/gl_info.py:124:
UserWarning: No GL context created yet.
/usr/lib/python2.5/site-packages/pyglet-1.1beta1-py2.5.egg/pyglet/gl/glu_info.py:124:
UserWarning: No GL context created yet.
/usr/lib/python2.5/site-packages/pyglet-1.1beta1-py2.5.egg/pyglet/gl/glu_info.py:149:
UserWarning: No GL context created yet.
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/pyglet/info.py", line 173, in _try_dump
  File "build/bdist.linux-x86_64/egg/pyglet/info.py", line 121, in dump_glx
  File "build/bdist.linux-x86_64/egg/pyglet/window/xlib/__init__.py",
line 471, in __init__
  File "build/bdist.linux-x86_64/egg/pyglet/window/__init__.py", line
669, in __init__
SystemError: Parent module 'pyglet.window' not loaded
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
open /dev/[sound/]dsp: Device or resource busy
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/pyglet/info.py", line 173, in _try_dump
  File "build/bdist.linux-x86_64/egg/pyglet/info.py", line 144, in dump_media
  File "build/bdist.linux-x86_64/egg/pyglet/media/__init__.py", line
1337, in <module>
  File "build/bdist.linux-x86_64/egg/pyglet/media/drivers/openal/__init__.py",
line 337, in driver_init
Exception: No OpenAL device.
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
open /dev/[sound/]dsp: Device or resource busy
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
open /dev/[sound/]dsp: Device or resource busy


2008/6/22 Alex Holkner <[EMAIL PROTECTED]>:
>
> On 6/22/08, Hugo Ruscitti <[EMAIL PROTECTED]> wrote:
>>
>>  Hi, i think that exist a problem with images created with pyglet.image.load,
>>  when i blit an image created with pyglet.image.load it show a little border
>>  that no exist in original image.
>>
>>  I create a example that show this problem comparing images creates with
>>  "pyglet.image.load" and "pyglet.resource.image":
>>
>>  screenshot of example:
>>  http://www.losersjuegos.com.ar/incoming/descargas/20080621/image_load.png
>>
>>  image used in example:
>>  http://www.losersjuegos.com.ar/incoming/descargas/20080621/0.png
>>
>>  -- %< --
>>  import os
>>  import pyglet
>>
>>  window = pyglet.window.Window()
>>
>>  image_1 = pyglet.image.load('0.png')
>>  image_2 = pyglet.resource.image('0.png')
>>
>>  @window.event
>>  def on_draw():
>>     window.clear()
>>
>>     for x in range(0, 400, image_1.width):
>>         image_1.blit(x, 200)
>>
>>     for x in range(0, 400, image_2.width):
>>         image_2.blit(x, 10)
>>
>>  pyglet.app.run()
>>  -- %< --
>
> This is an interesting example, that actually demonstrates a problem
> with your video card, as well as exposing some of the internal
> heuristics used by pyglet.  I hope you like messy details...
>
> pyglet.image.load() loads an image into system memory only (i.e., it
> just decodes the data, without uploading it to the video card).  The
> result of image.load() is an ImageData object.  When you call
> ImageData.blit(), a Texture object is implicitly created (via
> ImageData.get_texture()), which is where the actual OpenGL texture is
> created.
>
> You may know that for standard texture formats, OpenGL supports on
> textures with powers of 2 dimensions (e.g., 32x32, 16x64, 256x128,
> ...). When ImageData.get_texture() is called on an image with
> dimensions that do not conform (e.g. yours, which has dimensions
> 140x128), a larger texture is created (256x128), with the actual image
> data placed in the lower left corner.  The rest of the texture is
> initialised to black with 0 alpha.
>
> The border you are seeing is the interpolation between the edge of
> your image and the black/uninitialised area.  A conforming OpenGL
> video card won't show this border, but your video card apparently has
> a slightly different notion of where the center of a pixel/texel is.
> You could possibly tweak the generation of tex_coords in
> TextureRegion.__init__, but this would result in artifacts on other
> video cards.
>
> pyglet.resource uses the ARB_texture_rectangle OpenGL extension which
> allows it to create textures of non-power-2 sizes.  It does this
> heuristically for any image larger than 128x128 (smaller images are
> packed tightly into larger textures).  There are some limitations on
> the use of these "rectangular" textures, which is why pyglet doesn't
> create them by default.  You can explicitly request one though:
>
> image = pyglet.image.load('0.png')
> texture = image.get_texture(rectangle=True)
> texture.blit().
>
> I'd be interested to know what graphics card you're using (run "python
> -m pyglet.info" if you're not sure).  Updating your driver may also
> solve the problem.
>
> Cheers
> Alex.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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