1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice

SDL2 performance on OpenPandora

Discussion in 'C /C ++' started by Ellorion, Feb 17, 2016.

  1. Ellorion

    Ellorion Member

    Joined:
    Dec 1, 2012
    Messages:
    38
    I created a sdl2 demo app to check out the performance.
    Texture is drawn every frame to see how much time that operation takes.
    On 1Ghz Pandora it's almost 4ms or ~270fps (with LIBGL_FB=1 set or directly in code::blocks
    (which seems to set it automatically when the program starts))

    Source: https://mega.nz/#!zIAkgIbR!un1LMejipN7yRjdefbzPY6zyMrig7Hvau3KfraCbvis
    (with code::blocks project file, "pandora_debug"-build)

    Are these times/values as expected or am I still missing some configuration to get better performance?
    When I try to output text (not included in the source), I get around 3-5 fps (avg. per function execution)
    (which fills the entire screen) and uses a texturemap, which copies part of it to the window texture
    (to avoid lots of glBindTexture calls).
    I have no idea if this is to be expected, but it seems very slow to me, since it's already optimized for speed
    (at least based on the performance tests on my desktop pc)
    Would be nice, if someone could get some insight to this "witchcraft" ;)
     
    Tags:
  2. Pickle

    Pickle Mega GP Mania

    Joined:
    May 30, 2006
    Messages:
    5,373
    Location:
    Detroit, Michigan
    In general creating/updating texture information is going to be slow on the pandora (and most embedded opengles devices)

    Are you trying to use SDL_ttf to make each texture dynamically? This will be slow.

    It would be faster to use a font bitmap and draw each letter.
     
  3. Ellorion

    Ellorion Member

    Joined:
    Dec 1, 2012
    Messages:
    38
    I scan a text, generate the characters that are used, create a texturemap, where I store all needed characters and positions (on the texturemap) and blit every character from there instead of creating them over and over again. It's the fastest way I could find for text-rendering (at least on my desktop. Takes around 1ms to generate a text filling a screen of 800x480 there.)
    I also cache the data, so I only end up with texture-blitting, which is very slow.
     

Share This Page

Loading...