CoreGraphics questions
CoreGraphics questions
- Subject: CoreGraphics questions
- From: <email@hidden>
- Date: Sun, 10 Jun 2001 01:04:50 -0600 (MDT)
Hi,
I'm trying to write a simple game for OS X using CGDirectDisplay. I
set a 640x480x8-bit mode and then create a corresponding buffer (unsigned char*)
Currently, to blit, I map the base addresses of the screen and buffer to double
pointers and then copy from the buffer to the screen. This appears to be faster
than <mem.h>'s memcpy, but it still seems sort of slow. Is there a faster way to
blit?
I am also unsure of how to handle events. Currently, I am using carbon events to
receive kEventRawKeyDown, which works, but I want to move sprites around
during null events soon, and I don't think event timers will be fast enough. Is
there a very simple way to check for keyboard events in a loop? I might use a
WaitNextEvent loop, but it seems so un-OSX, and I rad somewhere that it is
implemented via Carbon Events anyway. So: what's the best way to handle key
presses if I don't care about other apps (since the user can't see them anyway)
Basically, I'm looking for any tips for a newbie OS X game programmer.
Thanks a lot,
Harold Cooper
email@hidden
email@hidden
email@hidden
http://physoft.n3.net