While not a direct answer, I can tell you that you can get better 
performance by drawing all of your tiles to a texture, then just moving the 
single texture around.  When you get to the edge of the texture, just draw 
a new one with new tiles and offset the texture accordingly.  If your tiles 
cover the screen totally, you wont need to clear the screen either.

On Saturday, December 5, 2015 at 6:20:34 PM UTC-6, Josh wrote:
>
> The problem has mostly stopped. I guess it may have been a very 
> straightforward framerate issue? I get occasional hiccups now but nothing 
> like it was before. Here's the code I set up for an MWE. If I have the 
> issue again, I'll try to figure out more specifically what's causing it.
>
> import pyglet
> from pyglet.gl import *
> from math import cos
>
> window = pyglet.window.Window(1200, 800)
> world_length = 3200
> world_height = 3200
>
> #set up viewpoint time dependence
> view_x, view_y = 0, 0
> wx = .67
> wy = .723
> time = 103.0
> def update(dt):
>     global time, view_x, view_y
>     time += dt
>     view_x = world_length/4*(1.0-cos(wx*time))
>     view_y = world_length/4*(1.0-cos(wy*time))
>     
> pyglet.clock.schedule_interval(update, 1.0/60)
>
> #set up openGL
> glClearColor(0, 0, 0, 0)
> glEnable(GL_BLEND)
> glMatrixMode(GL_PROJECTION)
> glLoadIdentity()
> gluOrtho2D(-600, 600, -400, 400)
> glMatrixMode(GL_MODELVIEW)
> glLoadIdentity()
>
> #create a bunch of tiles
> tile = pyglet.image.load('background_image.png') #background
> sprites = []
> batch = pyglet.graphics.Batch()
> for i in range(world_length/bottom.width+1):
>     for j in range(world_height/bottom.height+1):
>         sprites.append(pyglet.sprite.Sprite(tile, i*tile.width, j*tile.
> height,
>                                             batch=batch))
>
> def on_draw():
>     global view_x, view_y
>     window.clear()
>     glMatrixMode(GL_MODELVIEW)
>     gluLookAt(view_x, view_y, +1.0,
>                   view_x, view_y, -1.0,
>                   0.0, 1.0, 0.0)
>     batch.draw()
>     glLoadIdentity()
>
> window.push_handlers(on_draw)
> pyglet.app.run()
>
>
>
> On Saturday, December 5, 2015 at 4:47:34 PM UTC-6, [email protected] 
> wrote:
>>
>> Can you give more details on what your trying to render and how? Or 
>> provide an example that demonstrates the issue?
>>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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