It looks like you are running out of GPU memory.  You may need to manually 
delete the old circles, by calling the `delete` method on the vertex list. 


On Wednesday, September 19, 2018 at 2:36:42 AM UTC+9, Dan Liu wrote:
>
> def makeCircle(centerx,centery,r,numPoints=5):
>     verts = []
>     for i in range(numPoints):
>         angle = math.radians(float(i)/numPoints * 360.0)
>         x = r*cos(angle) + centerx
>         y = r*sin(angle) + centery
>         verts += [x,y]
>         
>     #print verts,len(verts)
>     circle = pyglet.graphics.vertex_list(numPoints,
>                                          ('v2f', verts),
>                                          #('c3f', (.100,.200,.8)), #can't 
> color
>                                          )
>
>     return circle
>     
>
> ... ...
>                 circle=makeCircle(centerx,centery,r,50)
>                 glColor3f(1,1,0)
>                 circle.draw(GL_LINE_LOOP)
>                 glColor3f(1,1,1)
>
>
>
> it will work well at first,,, but when it run some hours later, like 4 
> hours or more
>
> it will get a error in my bugsLog:
>
> Sep 18 08:28:05
> Traceback (most recent call last):
>   File "D:\aobD\pymunk.car.dist\pymunk.car.py", line 557, in glDraw
>   File "D:\aobD\pymunk.car.dist\pymunk.car.py", line 521, in makeCircle
>   File "D:\aobD\pymunk.car.dist\pyglet\graphics\__init__.py", line 292, in 
> vertex_list
>     return _get_default_batch().add(count, 0, None, *data)
>   File "D:\aobD\pymunk.car.dist\pyglet\graphics\__init__.py", line 370, in 
> add
>     vlist = domain.create(count)
>   File "D:\aobD\pymunk.car.dist\pyglet\graphics\vertexdomain.py", line 
> 279, in create
>     start = self._safe_alloc(count)
>   File "D:\aobD\pymunk.car.dist\pyglet\graphics\vertexdomain.py", line 
> 254, in _safe_alloc
>     buffer.resize(capacity * buffer.element_size)
>   File "D:\aobD\pymunk.car.dist\pyglet\graphics\vertexbuffer.py", line 
> 431, in resize
>     data = (ctypes.c_byte * size)()
> MemoryError
>
> Memory usage:18%  CPU:8.80%
>
>
>
> ... ... 
> ... ...
> ... ...
>
>
>
>
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyglet-users+unsubscr...@googlegroups.com.
To post to this group, send email to pyglet-users@googlegroups.com.
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to