[Alephmodular-devel] AlephModular and CoreGraphics update
Status: Pre-Alpha
Brought to you by:
brefin
From: Br'fin <br...@ma...> - 2005-07-13 05:36:08
|
I managed to implement text and bitmap display in CoreGraphics after a little bit of work. Text caches ATSU style information for current font, style, and size, thanks to a CFontSpecRepository class I had concepted to help SDL and OpenGL but which went unused during Carbon code. Bitmaps of 16 or 32 bits in depth are wrapped in a CGImageRef and CGContextDrawImage is used to draw them into the back buffer. For the indexed color bitmaps that are handled all over the HUD, I was able to provide a serial CGDataProvider to return the 16bit/32bit pixel colors for the indexed colors. I suppose bitmaps could be directly blitted by ourselves and a bit more work, but it's unclear if that's the best option, with some notes around that wrapping bitmaps in CGImageRefs and using CGContextDrawImage may result in speed improvements over raw blitting due to optimized paths the OS may be able to setup in the transition from main memory to VRAM. At any rate, AlephModular in CoreGraphics (AM-CG) on my machine runs full screen, and approximately the same FPS as the Quickdraw based version. AM-CG is also really raw whenever dialog boxes are used. They show up and overwrite the main image, and in addition, they may be missing functionality. For instance, pop-up menus are invisible due to the window shielding levels. -Jeremy Parsons http://alephmodular.sourceforge.net/ |