PocketMatrix forums

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

Why EasyCE?

Hmmm im not trying to be rude jacco, im just curious what advantges EasyCE has now that, that OpenGL clone for the ppc is out. Is EasyCE capable of those kind of graphics too?
Robert,

No, EasyCE does no 3D at all. That's not it's purpose btw, in fact EasyCE 1.5 already does more than it really should. The basic idea is that EasyCE takes away the burden of platform specific stuff, and JUST THAT. So: Going full-screen, reading the stylus and the buttons, and nothing else. I added some small things that every game needs, for convenience.

I hope to release additional libraries that handle things like 3D and mod playing, but that will not be part of EasyCE (although it will of course work WITH EasyCE).

- Jacco.
What OpenGL clone?
Pocket GL or somthing. I belive your the one who posted the news about it in the dev forum.
EasyCE provides a simple way to utilise GAPI which gives direct drawing to the screen. It's not easier to use than the windows API functions but it gives the best performance and Easy CE does so much of the work that it's accessible to most coders.

PocketGL is not an OpenGL clone but is a GAPI based 3D textured-mesh toolkit. There are quite a few similarities to OpenGL but nothing like the command set yet. Pierre is working on the next release due in a week or so.

The actual screen drawing method is the same approach as EasyCE and with a little work both tools can be merged as the source is available. EasyCE is free though I think Jakko wants people to pay something for commercial use? PocketGL is $49.

Jakko wrote a 3D sample a few months back ( a nice rotating cow ) so he knows how to load mesh files and render textured 3D images but he can't do everything at once. His tutorials are also very useful to me coming from a non C++ background
EasyCE has a 'theoretical' price of $100 if you use it for a commercial product. In practice, I only ask people to pay that once they earned a decent amount of money (> $500). I don't want anyone to stop from doing cool stuff with EasyCE, but I found that some companies are using EasyCE without giving me credits or an e-mail. That's bad for code sharing, and so I now have this 'price', wich I never actually received btw., and I frankly don't care. :) Basically, I just want to be able to sue Zio if they use EasyCE without asking me. ;)
Phantom, Do you have a paypal account or some other ez-2-pay type of account?  Just curious.

Thanks for all the detail i thought easce was just a graphics library.
Yes, I have a Paypal account. I don't have a creditcard though so the Paypal is (conveniently) limited to $100. I'll get a Visa soon though, it's getting very inconvenient NOT to have one. :)
Cool, it's sooo much easier to pay online like that rather than send a check.

BTW, I would definately pay for EasyCE if I made 500 on a game.  Thats a fair enough price.

Also, I am currently working on a personal game library that lacks some of the easiness and trades it for speed.  Just out of curiosity, do you plan on improving the speed of easyce, or is that at the bottom of the list of priorities?

Also, I noticed that there is a LOT of multiplication in the easyce code, do you know if the microsoft compiler optimizes that to bitshifting, or would it be better to do that by hand?

Great work!

even with all compiler optimizations turned on, hand-optimized EasyCE is ways faster (and a mess to read and understand). It is not meant to be the fastest GAPI wrapper around, it's name would be FastCE then :)

If you're after speed, there is *a lot* you can squeeze out of EasyCE without going into ASM.

cryo
GeoffSulcer · 12 Nov 2001, 16:13 UTC



If you're after speed, there is *a lot* you can squeeze out of EasyCE without going into ASM.



Sounds like possible future tutorial topic?

Ok, that was what I was finding, all the old "DOS days" tricks to squeeze performance were missing and I wasn't sure if that was intentional for ease of readability, or if it might just not matter with more up to date compilers.

For my own projects, I always optimize those little things like multiplication/division -> bitshifting and the like.  I guess I just don't trust the compilers to make the best decisions yet ;)
Apparently this is still not clear, but EasyCE is *NOT* a graphics primitive library. The ONLY reason it sports a line function is to make the initial steps in game development easier (I also mentioned prototyping earlier). EasyCE's purpose is to go full screen, and return control to the programmer. That's it. I don't see why you want that to be fast. :)

And the primitives: Your are supposed to write your own. The ones in EasyCE are convenient placeholders. EasyCE doesn't take away the responsibility to write good code. It ONLY takes away the unneccessary burden of tricking WindowsCE in a state that is cool for games.

But, if you think you can better (WITHOUT making them less generic) do so and send the code to me. I'll gladly add it to the next version of EasyCE.

I could spend four hours on EasyCE now and make sure everything is optimized, but I'm not going to do it. If you think that it matters, you don't understand what EasyCE is supposed to do.

- Jacco.
The major advantage for me using EasyCE was that it made implementing for different platforms really easy. My emulator is working perfect on Casio's and HP's, even if I only have access to an iPAQ. And if there is something "wrong" with EasyCE the source code is available so you can always modify it to your needs.

By the way, are you Jacco thinking of adding a work around for the iPAQ 3800 problem (slow GAPI update) in a future release of EasyCE?

/Anders
Anders,

Where can I find out more about the so-called "slow GAPI update" problem with the new iPaq?  Can you provide details?

Mike Wagstaff · 13 Nov 2001, 19:15 UTC
Doug Beck, RocketElite author, posted this message which you may find helpful recently in the Pocket PC Game Programming Yahoo group:

Hi, all.  Thanks to the guys over at PocketTV who have been looking at this
issue for about 3 weeks now, we have a working work-around for the 3800
series iPAQ devices.  This work-around in pretty ugly, but it does work
like a charm.

You can detect the type of device with
SystemParametersInfo(SPI_GETOEMINFO,...);

When you detect that you run on a 3800 series, you should:

1) assume that GXIsDisplayDRAMBuffer() returns False

2) Never call GXBeginDraw, and assume that it returns 0xac0755a0

3) Never call GXEndDraw

4) Assume that the properties are:

cxWidth = 240
cyHeight = 320
cBPP = 16
ffFormat = 168
cbyPitch = 2
cbxPitch = -640

In addition, Microsoft is taking up the issue with Compaq so hopefully a
patch will be available so that current software will also work.

Now, if you didn't write your graphics primitives to work with these x & y
pitch values....God help you ;o)


Pocket PC Game Programming Yahoo group:
http://groups.yahoo.com/group/Pocket-PC-Game-Programming

More developer links:
http://www.pocketgamer.org/links/developer.shtml
Actually, that was posted by the Pocket TV people. :)

Dan East
Thanks for the info Mike.  That is really surprising and just goes to show you how much Compaq and MS want to support GAPI and all us gamers.  They seem to only be concerned on the big corporate and enterprise customer with the Pocket PC.  Am I to infer that no GAPI-based games currently run on this device without modification?  Wasn't there also some screw up with reading button presses on these new iPaqs too?

It's funny that with those pitch numbers listed in your post the new iPaq is still a native landscape display but it's rotated the other way from the 36xx devices.  Holding the device in your hand, the start of frame buffer memory would be in the upper right corner and incrementing addresses would move down the display, with the end of the frame buffer at the lower left corner of the display.  The 36xx devices start at the lower left and move up the display with increasing addresses.



Instead of everyone going out and modifying their code and releasing new versions of their apps just to work around this performance issue on these specific devices, it would make far more sense to create a gx.dll for use on these devices. You would leave the "real" gx.dll in the \windows\ dir, and place the new gx.dll in the directory of the app that needs it. It would simply return the appropriate values as indicated above, and thunk down to the original functions for those that aren't changed. The dll should be smart enough to thunk down to all original functions if it is not one of the affected iPaq devices.

Dan East
Dan,

I'm still unclear on what the performance issue is with the 3800.  Which GAPI APIs are slower?  I was under the impression from Mike's post that the APIs were just plain broken.



For clarity: The new iPaq *do* work with GAPI. There is *no* compatibility issue.

HOWEVER: Internally, things are different. The hardware frame buffer is rotated 180 degrees; instead of the landscape buffer that the original iPaqs have, the 3800 has a mirrored landscape buffer.

THAT DOESN'T MATTER: Gapi seems to take care of this. But: There's a speed penalty. GAPI needs to convert from the old iPaq display buffer to the new one; this requires an expensive operation.

So, instead of converting a portrait buffer to landscape (wich lots of apps, including EasyCE, do) and converting that to the native 3800 format, we can have faster graphics if we use the new 3800 internal format directly. And that's exactly what Dan, Douglas and the PocketTV guys are talking about.

Hope it's clear now. Also hope I didn't insult anyone with this explanation. :)

- Jacco.
Thanks for clearing that up.  I understand where the perf hit is now.

So what does SystemParametersInfo(SPI_GETOEMINFO,...); return for a 3800 model?
Well I've added some code to EasyCE to handle the 3800 problems. Before I start bugging anyone with buggy beta code, could someone have a look at the following snippets to see if there's anything obvious wrong?

This is the code to convert the 240 * 320 portrait buffer to the 3800 landscape version:

Code:

if (ipaq3800)
{
  PIXEL* dst = 0xac0755a0;
  PIXEL* src = getbuffer();
  for ( int y = 0; y < 320; y++ )
  {
     PIXEL* ldst = dst;
     for ( int x = 0; x < 240; x++ )
     {
        *(ldst) = *src++;
        ldst -= 320;
     }
     dst++;
  }
}


And here is the code to detect the 3800:

Code:

WCHAR oemstr[100];
SystemParametersInfo( SPI_GETOEMINFO, sizeof( oemstr ), oemstr, 0 );
ipaq3800 = false;
if ((oemstr[12] == 'H') && (oemstr[13] == '3') && (oemstr[14] == '8')) ipaq3800 = true;


The weird test is based on the assumption that the string starts with Compaq iPaq H38 (wich seems logical, given the strings for older devices that I found somewhere).

One other question: The x and y pitch indicate that the 3800 display is in fact the same (internally) as the older iPaq screens: The screen seems to be rotated 90 degrees to the left. I thought someone said it was rotated to the right?

Anyway, once this code is working and stuff, I'll release a new version of EasyCE so that everyone can benefit.

- Jacco.