Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to use SDL + OpenGL but I don't believe hardware acceleration is working because the framerate for around 18000 polys is about 24fps on a quad core machine but is a hopeless 1-2fps on an Intel Atom. Even the quad core starts to struggle when the poly count rises above this.

I've checked my code over but I'm clearly missing something obvious. I've changed my SDL initialisation code to use the same code as in the SDL OpenGL test. It reports that SDL_GL_ACCELERATED_VISUAL is 1 but that hw_available in SDL_VideoInfo is 0

Also the vendor is reported correctly as Nvidia on both machines and accelerated apps such as Compiz and glxgears work fine.

Any ideas of what to try?

Thanks

share|improve this question

1 Answer 1

up vote 6 down vote accepted

If you are using glBegin()/glEnd() in your code, especially if setting textures and states redundantly between frames (i.e., draw with texture 1, then 2, then 1, then 2, as opposed to 1,1,2,2), you probably are incurring driver overhead. Especially this is the case if you are noticing that a slow processor is chugging while it still has a good card. Using glDrawArrays or similar usually has much better performance.

Without a full code listing, though, there really isn't a way to know for sure. SDL is a pretty thin wrapper, so unless you are doing something really weird I wouldn't expect an error. Also, what cards are being used?

share|improve this answer
    
The card on this machine is a nVidia Corporation GT218 [ION]. I understand it's going to be a little slow before I optimise but not this slow. I'm binding 1 texture and using it to draw a simple heightfield admittedly of 1 triangle at a time. So a pretty awful way to do things but even so, slower than expected. –  Robin Elvin Apr 22 '11 at 6:56
1  
Just taken the glBegin()/glEnd() calls outside the loop and tweaked the draw routine accordingly and framerate is up to 30fps. So I've leant what a drastic effect those calls make when used unwisely :) Thanks! –  Robin Elvin Apr 22 '11 at 7:17
    
No problem. Glad I could help. –  ChrisE Apr 22 '11 at 15:31
    
@ChrisE What do you mean "SDL is a pretty thin wrapper"? –  Chris Mar 30 '12 at 5:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.