PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Pocket PC battery life

I want to know how GapiDraw 3.6 affects the pocket pc battery life?

if there are any statistics it will be great.
You mean in comparison with the older versions ?
Who knows, just check the optimization enhancements on the release info, you will know if they are related to the performances or not.

Basically, the battery life is affected by the processor performance. The more your game/application needs CPU, the more the battery is affected.

To manage this need of CPU resources, you have to implement some tricks like :
- Have the lowest FPS rate possible according to the lowest animation smoothness you need (check the topic about the smoothness/FPS management)
- Code the best optimized algorithms on your methods
- Stop the refresh when nothing happen in the display (If you don't refresh anything, the display stays the same)

For the last one, I think that is typically the way the display refresh of an Operating System runs. When you don't use it, there is no refresh for the main display and/or all the graphical subcomponents of the main display (like the refresh inside the windows, etc.)

It could be something like that :
Code:

// THIS IS WRONG BECAUSE THE BLACK FILLRECT WILL BE CALLED ON EACH FRAME
ProcessNextFrame(CGapiSurface * pBackbuffer)
{
backbuffer->FillRect(NULL, RGB(0,0,0), NULL, NULL);
if (!refresh)
MyFunnyGame(pBackbuffer)
}

// THIS IS GOOD
ProcessNextFrame(CGapiSurface * pBackbuffer)
{
if (!refresh)
MyFunnyGame(pBackbuffer)
}
The most important thing you can do to conserve battery is Sleep() if the FPS is above your target value. I don't know how that fits within the context of GapiDraw (ie if it will sleep automatically if the FPS is high).

Dan East
I found this method in the CGApplication class documentation :

CGapiApplication::Pause (Win32 only)

Pauses the application and skips the call to CGapiApplication::ProcessNextFrame in the subclass.

virtual HRESULT Pause(DWORD dwNumFrames);

Parameters

dwNumFrames
The number of frames to skip the call to CGapiApplication::ProcessNextFrame in the subclass.

Return values
The return value is S_OK.[/b]

I think that call this method is the right way to use the Sleep() method.