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

  • SEARCH
  • Home
  • 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 7513679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:15:36+00:00 2026-05-30T00:15:36+00:00

So I just started switching over from SDL to OpenGL today and I’m having

  • 0

So I just started switching over from SDL to OpenGL today and I’m having this problem which I didn’t have when I was using SDL.

When there’s a lot of stuff on the screen the whole thing goes into slow motion. And when I say a lot I mean 200+ objects, but starts to be noticeable maybe from 50.

This is how things are rendered, I have a class Renderable with a virtual void render() which is called by the RenderManager in a loop void manage() which calls render() for every Renderable on screen.

The main loop looks like this

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();

_renderManager.manage();

glFlush();
SDL_GL_SwapBuffers();

and render() for the objects I’m using are only squares so

glBegin(GL_QUADS);
// Draw square with colors
glEnd();

My CPU usage or memory usage don’t seem to be high at all, it’s just like… the game is slowing down.

  • 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-30T00:15:37+00:00Added an answer on May 30, 2026 at 12:15 am

    I guess the problem is that you are using immediate mode, you should use Vertex Arrays if you have performance problems.

    We don’t know all of your code so it’s difficult to give a complete answer but using vertex arrays is surely the first step you should ensure if things go slowly.

    Take a look here: http://www.songho.ca/opengl/gl_vertexarray.html

    Basically the fact is that with glBegin…glEnd you end up doing many calls to the GPU while with vertex arrays you precompute your shapes, you save them in buffers and directly draw them reducing the number of calls by a significant amount.

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

Sidebar

Related Questions

Just started learning PySide and is having problem with QTimer I have this #!/usr/bin/python
Just started working with .NET and MVC(1). I'm having a problem wherein in my
I'm just getting started switching from flash to flex for the better components. I
I am apparently having a huge problem switching from the plugin version of Paperclip
I know this is something i should have learned before switching to opengl es
I just started switching my old DTD over to XSD when I found out
Just started coding in AS3 with FlashDevelop and coming from a C# background, I
Right guys, I have just started getting into Xcode 4, with the intention to
I just started exploring Scala in my free time. I have to say that
Just started looking into redis. Redis is a single-threaded process. Does this mean all

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.