Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7507535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:30:21+00:00 2026-05-29T22:30:21+00:00

I have some code that creates a batch using the pyglet library. The whole

  • 0

I have some code that creates a batch using the pyglet library. The whole thing contains about 10 000 quads when fully loaded. Now when I run the script which renders the whole scene (it is a completely static scene), I get 3FPS. The only thing that in the prototype I used for the scene renderer, I would build up the map using some slow and sloppy written python code, which happened to also run at 3FPS for the exact same scene. Since the batches in pyglet are managed using C++, I have this bothering feeling that I am missing something obvious that causes the batch to draw at 3FPS.

This is my scene initialization code:

glViewport(0, 0, width, height)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(60.0, float(width)/height, .1, 10000.)
glMatrixMode(GL_MODELVIEW)
glClearColor(94.0/255.0, 161.0/255.0, 255.0/255.0, 0.5)
glClearDepth(1.0)
glShadeModel(GL_FLAT)
glEnable(GL_DEPTH_TEST)
glDepthFunc(GL_LEQUAL)  
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

And this is the code that runs each frame to render the scene:

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
glTranslatef(0, 0, -1*self.mapZoomLevel)
glRotatef(self.mapPitch/5, 1, 0, 0)
glRotatef(self.mapRotation, 0, 0, 1)
glTranslatef(self.mapX, self.mapY, 0)
self.mapPrimitive.batch.draw()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:30:22+00:00Added an answer on May 29, 2026 at 10:30 pm

    If the scene is static, it should be easily fixed using a display list. Some vendors optimize display lists by converting them to VBO and glMultiDrawElements() internally so some lousy 10k quads should be no problems. And it’s like four lines of code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that creates a new site in SharePoint. Upon browsing to
I have some code that dynamically creates a new button through JavaScript that when
I have some javascript code that creates an img tag with a mouseover callback,
I have some Javascript code that creates 2 arrays: One for Product Category and
I have some code on my PHP powered site that creates a random hash
I have some code that creates a CSV file. The order of the rows
I have some code that creates panels with picture boxes in them. I would
I have some code that creates objects in a foreach loop. So: private IEnumerable<StrongTypeResult>
I have made some code that creates a red border around an image when
I have some code that creates a multi-dimensional array, but my result seems to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.