Page 1 of 1

Testing an app in the emulator

PostPosted: Aug 5, 2008 @ 3:37am
by Nacho84
Hi! I'm making a simulation game using edgelib and, since I don't own a PocketPC myself, I'm developing it in Visual C++ Express 2005 and compiling the project from time to time in embedded Visual C++ 4 and testing it in an emulator (the Professional VGA that comes bundled with the Windows Mobile 6 SDK).

Anyway, during my last tests I've noticed that when I draw text using the DrawFont method from E2DSurface I get weird results in the emulator, although I get a correct output in the Windows desktop version. I'm attaching an image that shows the emulator's output on the left and the Win32 desktop's output on the right so that you can see what I mean.

I'd like to ask you if you have experienced any kind of incompatibility when running your edgelib's applications in the Windows Mobile 6 emulators and, if you did, how did you solve them.

Thanks in advance for your answers,

--Nacho

PostPosted: Aug 6, 2008 @ 11:25am
by edge
Hi,

When I look at the attached picture, it's strange that only 'GOALS' is written in an odd kind of way. Are the other texts (that display correctly) also written using DrawFont?

Does the bug also appear on the Windows Mobile 5 emulator?

PostPosted: Aug 6, 2008 @ 1:27pm
by Nacho84

PostPosted: Aug 6, 2008 @ 6:11pm
by Nacho84

PostPosted: Aug 8, 2008 @ 8:38am
by edge
Hi,

I think the error is caused by memory corruption (such as writing to a NULL pointer, an uninitialized pointer, or writing out of bounds). This is usually the case when errors seem appear randomly.

Maybe it's a good idea to make a few tests using the helloworld sample. Also test if the error only appear when using certain font images.

PostPosted: Aug 9, 2008 @ 9:15pm
by Nacho84
Hi edge,

I've reviewing the helloworld sample and the source code of Blastar. Unfortunately, the helloworld sample writes directly to the screen buffer and I'm writing to an intermediate surface, so it kinda doesn't apply to my current problem.

Nonetheless, one thing I've noticed in Blastar's source code is that all the surfaces are stored as E2DSurfaces. In my project, I store everything as E2DSurfaces * and call the new operator in the class' constructor.

So, I modified my GUIStaticText class and replaced every E2DSurface* by an E2DSurface and it seems to be working correctly now. Since I cannot make that same replacement in all my game classes (because the amount of surfaces per widget is not fixed), should I call an E2DSurface method after creating the surface with the new operator and before calling EDisplay::CreateSurface?

I perused the documentation and found that there's a method named Clear, so I tried invoking it right after using the new operator and it crashed the application (as I expected, because the surface hadn't been created by ClassEDisplay::CreateSurface).

Thanks again for all your help,

--Nacho

PostPosted: Aug 10, 2008 @ 1:08pm
by Nacho84