(more) GAPI and sound questions, as well as general game dev concepts

Started by
1 comment, last by RobertPaulson 19 years, 2 months ago
Hiya, I'm currently trying to make a very simple little game for the PocketPC (having a sucky 200Mhz XScale myself). The thing is, I'm currently using: * FMOD for playing back MP3's/OGG's (going to change to PortAudio) * GDI I've also got a poorly implemented GAPI GFX plugin, which is what I'd like help with. The GDI works perfectly smoothly and fine when I replace the FMOD plugin with a NULL sound plugin. But when the MP3's come a rolling, things become very jerky. With the GAPI plugin, things are a lot smoother, but jerk every now and then. The way I've implemented the GAPI plugin is: I create my own buffer, into which I draw a background, a control overlay, and several sprites, which I then flip into the buffer that GXBegin returns. Now, what I'd like to know is: the buffer that is returned by GAPI, is it a direct-to-screen buffer? Would writing to it be slower than using the buffer I've created? If not, would drawing only the changed areas directly to the GAPI buffer be quicker than blitting the entire double buffer? Also, I'm using either a fast timer, or a tight loop where I Sleep(0) in for my main game loop (in which case I lose some stylus input...?), how do you make a fast GAPI game loop? Do you need to handle paint messages? Any opinions would be appreciated, thanks. (Except: I'm not interested in using GapiDraw, I want to do this myself)
Advertisement
GXBeginDraw can return a pointer to an intermediate buffer that isn't the true frame buffer. When your app calls GXEndDraw, the driver copies the contents of the intermediate buffer to the actual display RAM. You can determine that this is happening by calling GXIsDisplayDRAMBuffer. If that returns TRUE, then you won't want to manage your own back buffer as you'll be performing an unnecessary copy each frame. Just compose your frame to the buffer returned by GXBeginDraw and let the driver do the copying.

If you're running fullscreen, you don't need to worry about paint messages since you're clobbering the whole screen with your GAPI update each frame.

Do yourself a favor and visit the dev forums on www.pocketmatrix.com. Lot's of competent people there that have been through what you're going through for years.



Right, okay. Well, thank you very much for your reply, and I suppose you'll see me in the pocketmatrix forums then :)

This topic is closed to new replies.

Advertisement