Re: Basic Games framework in Cocoa...
Re: Basic Games framework in Cocoa...
- Subject: Re: Basic Games framework in Cocoa...
- From: David Remahl <email@hidden>
- Date: Tue, 12 Feb 2002 00:57:00 +0100
>
[I'm posting this to Games Dev and Cocoa Dev because the question seems to
>
overlap both arenas]
>
>
I'm working on a sprite based game in Cocoa.
>
I was wondering if anybody can point me in the right direction...
>
>
I need a framework or explanation of how to implement all the general game
>
functionality (full screen, key capture, etc)
>
>
How do I change to full-screen and capture all key presses (even single
>
function keys) etc... (I understand you can't do this with Cocoa currently
>
;-(, have to use Carbon)
To capture the screen, use the DisplayKit
<
http://www.macupdate.com/info.php/id/6918>. And yes, you can use carbon to
capture key states.
>
Can I use tranparency for the sprites like Apple's 128x128 icons... (I was
>
thinking if there is are icon load/display methods in Cocoa I might use the
>
Icon format for my sprites and scale them to the size I need with
>
NSAffineTransform)
No, these are displayed and loaded as any other image (using NSWorkspace) in
Cocoa. You can use TIFF's with transparency in, and you won't be restricted
to 128x128 format.
>
How does a NSView display in fullscreen? or do I have to get more low level?
>
>
I know there are OpenGL objects/methods, but then can I use the NSView or
>
interface builder?
NSOpenGLView is a subclass of NSView, and can be added in Interface Builder.
>
What about screen updating? Do I have to force updates? Do I have to buffer
>
images offscreen? (I hope not... I'm hoping Quartz takes care off all this
>
;-)
You should probably use OpenGL, but you will need to tell the system to
update drawing, possibly using an NSTimer to call your drawRect: method. You
can use NSImages, and those are buffered offscreen (naturally), or you can
roll your own stuff...
>
How do I give my game process priority... (I know, I'm not going to hog
>
processor time, just an option)
>
>
There may be other stuff, but this is what I'm most worried about at the
>
moment.
>
>
>
Thanks in advance,
>
Adam
>
Ps Seems the game objects/physics system is the simplest part of this whole
>
thing ;-)
Never.
/ david
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.