Jump to content

  • Log In with Google      Sign In   
  • Create Account


Arivor

Member Since 08 Mar 2012
Offline Last Active Apr 03 2013 07:58 AM
-----

Posts I've Made

In Topic: SDL_Layer even slower than SDL?

26 January 2013 - 01:57 AM

Hmm... that looks okay.

I just don't see anything obviously wrong in your code, so I was hoping it might be a driver issue. But like I said, it's been years since I used SDL. You might try digging into the guts of SDL Layer to see if it is doing anything stupid behind the scenes.

Okay, thanks for your help anyway. I'm not that great an expert, but I'll definitely take a closer look at the SDL_Layer files.

 

 

You say it's "just as slow as vanilla SDL". You wouldn't be measuring your speeds in FPS, would you? Because measuring performance by FPS gives deceptive results, and you should measure by millaseconds or microseconds per frame.

 

Example: An improve from 1 FPS to 2 FPS is a 1 frame increase... which is 500 millaseconds of increase.

An improvement from 50 FPS to 51 FPS is a 1 frame increase... which is only a 2/5th of one millasecond of an increase.

 

What are the actual speeds you are getting, measured in average millaseconds per frame?

 

Sometimes, just drawing one object per frame may take alot of processing, but for each subsequent object, the increase might be very minor. Have you already tested with 100 objects on-screen? Have you tested with 1000? Then you can calculate what is the average decrease in performance per object, after excluding the initial baseline cost of drawing any objects at all.

 

Further, have you converted your surfaces properly (when loading them) to be optimized to the format of the screen you are rendering to? If you don't convert them once per image after loading, then they'll have to be converted each and every time you draw the image, which can slow you down.

 

I apologize if this is information you already know - I'm not familiar with your skill level and knowledge, so I might be pointing out the obvious. laugh.png

No need to apologize. You brought me onto the right track, I think. With SDL_Layer I get a stable 21 ms/frame, which goes up to around 28ms/frame with a thousand (small) objects. So it was my code: When I first wrote it for vanilla SDL, I regulated the speed by limiting it to one update for every few frames (dumb idea, I know...). So if I update once per frame, I can use SDL_Layer without lag. A thousand objects at once should suffice for a small project like this.

Btw, I tried with and without SDL_DisplayFormat() and cannot make out any difference (neither by eye nor by measuring).

 

 

Maybe a stupid question, but have you made sure your video drivers are up to date? It's been years since I used SDL, but IIRC it uses OpenGL on the backend, so if your GL drivers are still Microsoft bundled or otherwise non-accelerated, then OpenGL is going to be sloooow.

Actually, SDL 2.0 I believe is heavily attached to OpenGL, but with SDL 1.2 I think it's only true OpenGL code that benefits from hardware acceleration. I could be wrong though, I don't know if initializing the screen with SDL_OPENGL can be done without OpenGL specific code, but he could try adding that to the flags when calling SDL_SetVideoMode().

 

Don't know for sure though, just something to look into.

I'm able to use that flag, but with SDL_Layers it just gives me a black screen. No idea if that's SDL_Layer's fault or that flag just needs some special code.

 

 

Thanks for all your help! Going back to coding now ;-)

-Arivor


In Topic: SDL_Layer even slower than SDL?

25 January 2013 - 08:42 AM

$glxinfo | grep render
direct rendering: Yes
OpenGL renderer string: Mesa DRI Intel® Ironlake Mobile 
    GL_NV_conditional_render, GL_ARB_ES2_compatibility,

In Topic: SDL_Layer even slower than SDL?

25 January 2013 - 08:26 AM

I'm on Linux Fedora, and as far as I can tell, all my drivers are up to date.

-Arivor


In Topic: Beginner hoping for a few pointers

12 March 2012 - 10:21 AM

Have you considered something like ActionScript? Artists in my university use it to make simple games that turn out to be pretty good too.

I don't really like flash, so I never got into that language. I have no idea if it suits my purpose. Thanks for the suggestion anyway.

For now, I'm finding my way with JME. Once I got blender 2.62 to export ogre/xml files, I might use that to do a 3D tile based game.

Sincerely
Arivor

In Topic: Beginner hoping for a few pointers

11 March 2012 - 09:40 AM

I'm not much of a Java programmer, but I've heard good things about jMonkey.

Thanks, that looks interesting. Could be a bit overpowered for my purposes, but I'll definitely take a closer look.

I tried PyGame two or three times and wasn't too happy with it, but that's just my personal experience.

Sincerely
Arivor

PARTNERS