[SDL] Meeting low power device demands

Alex Barry alex.barry at gmail.com
Tue Jul 19 17:19:42 PDT 2011


I agree with what you're saying, but I don't think it completely fits
the philosophy of SDL.  SDL has always been a bare-bones system, and
it should be up to the programmer to figure out the power needs of a
particular device.
On the flip side, however, I can see that this would work well with
the currently implemented event system.
>From there, we have two options - build SDL with a new event for
redrawing, or just use the built-in user event interface.

Honestly, this sound like it would be good for either a forked version
of SDL, or some sort of user add-on library, rather than residing in
SDL's core.

Those are just my thoughts - maybe some people will desire this to be
built in, and i'm sure ryan or another dev will accept a patch if
there is enough community desire for a power-friendly paint event.
-Oz

On Tue, Jul 19, 2011 at 7:20 PM, Nathaniel J Fries <nfries88 at yahoo.com> wrote:
> SDL has had ports to the iPhone and homebrew NintendoDS for quite some time
> now, and older versions of SDL are also used in webOS and homebrew PSP
> development (SDL 1.3 is supposedly available as part of webOS "PDK" now
> too). Last year it gained an Android port as well. However, it hasn't meant
> the demands of these lower-power devices.
>
> The typical SDL application polls for events and then draws, with no idea of
> the demands of these low-power systems in maintaining battery life. In fact,
> SDL doesn't provide any sort of "should redraw" notification for
> applications intended to run on these devices. Applications running in such
> a manner will kill the battery rather quickly compared to apps that
> correctly render only when needed (the programmer will know: render when the
> screen needs to be updated, or after a "should redraw" event happens). This
> would be the equivalent of a Win32 application using WM_PAINT, an X11
> application using the "Expose" event, an OS X application overriding
> NSView's drawRect member function, an iOS application overriding UIView's
> drawRect member function, or an Android application overriding
> android.view.View's onDraw member
> function/android.opengl.GLSurfaceView.Renderer's onDrawFrame member
> function.
>
> Another issue is low memory warnings. I know for a fact that both Android
> (android.app.Activity's onLowMemory() function) and iOS
> (UIApplicationDelegate's applicationDidReceiveMemoryWarning function)
> provide these warnings, SDL should generate an event for them.
>
>
> Just thoughts as I was researching Android and iOS application development.
> Good luck.
>
> ________________________________
> EM3 Nathaniel Fries, U.S. Navy
>
> http://natefries.net/
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>



More information about the SDL mailing list