I added the stack trace below.  I'm using Pyglet 1.1 Beta 2, by the
way.   One interesting thing I noticed is printing out "size" and
"self.size" immediately before line 370 of vertexbuffer.py yielded
this result:

                print size, self.size
                glBufferSubData(self.target, self._dirty_min, size,
                    self.data_ptr + self._dirty_min)

131084 131072

It looks like the buffer may already have been created, but the size
slightly changed and is now being resized improperly.  Or, maybe the
first size is my vertex buffer and the second is my colors?  Both
lists should be the same size, though.

Traceback (most recent call last):
  File "C:\development\normalproblem.py", line 37, in <module>
    pyglet.app.run()
  File "C:\development\pyglet\app\__init__.py", line 264, in run
    EventLoop().run()
  File "C:\development\pyglet\app\win32.py", line 47, in run
    self._setup()
  File "C:\development\pyglet\app\__init__.py", line 153, in _setup
    window.dispatch_pending_events()
  File "C:\development\pyglet\window\win32\__init__.py", line 842, in
dispatch_pending_events
    event[0](*event[1:])
  File "C:\development\pyglet\window\win32\__init__.py", line 1115, in
_event_size
    self._immediate_redraw()
  File "C:\development\pyglet\window\win32\__init__.py", line 1068, in
_immediate_redraw
    self.dispatch_event('on_draw')
  File "C:\development\pyglet\window\__init__.py", line 1216, in
dispatch_event
    EventDispatcher.dispatch_event(self, *args)
  File "C:\development\pyglet\event.py", line 340, in dispatch_event
    if handler(*args):
  File "C:\development\normalproblem.py", line 35, in on_draw
    vertexList.draw( GL_LINES )
  File "C:\development\pyglet\graphics\vertexdomain.py", line 332, in
draw
    self.domain.draw(mode, self)
  File "C:\development\pyglet\graphics\vertexdomain.py", line 264, in
draw
    buffer.bind()
  File "C:\development\pyglet\graphics\vertexbuffer.py", line 371, in
bind
    self.data_ptr + self._dirty_min)
  File "C:\development\pyglet\gl\lib_wgl.py", line 94, in __call__
    result = self.func(*args, **kwargs)
  File "C:\development\pyglet\gl\lib.py", line 105, in errcheck
    raise GLException(msg)
pyglet.gl.lib.GLException: invalid value
Press any key to continue . . .

On Feb 7, 2:08 am, Alex Holkner <[email protected]> wrote:
> On Sat, Feb 7, 2009 at 2:33 PM, Mike Wyatt <[email protected]> wrote:
> > I'm having a strange issue when I try to create a large VertexList of
> > lines.  My ultimate goal is to render the normal vectors for a heightmap,
> > but for now I just want to get it working with basic "up" vectors.  I'm
> > getting an "invalid value" error when I call vertexList.draw( GL_LINES ) for
> > certain sizes of VertexList.  A list of 4096 lines (64x64) fails, but 4160
> > lines (64x65) works fine.
>
> > The best explanation would be example code, so I attached a basic pyglet app
> > that renders a 64x65 grid of lines.  Changing the number of columns to 64,
> > for example, throws the error.  Other values, like 1 row of 32 columns, also
> > fails.
>
> I wasn't able to reproduce the bug -- every sized grid I tried worked.
>  It's possibly a garbage collection bug -- sometimes Python destroys
> array data while it's still being transferred to the GL driver; this
> can lead to the kind of intermittent problem you're seeing.  Perhaps
> the full stack trace would help pinpoint the problem.
>
> 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