Re: Confused about CFRunLoop

2008-03-18 Thread Eric Schlegel
On Mar 18, 2008, at 7:23 PM, Brian Greenstone wrote: Actually, no. Not for games. For games we use the HID Manager for input which allows us to use more than just the keyboard and mouse. It allows for gamepads, steering wheels, tablets, etc, etc. The code doesn't even need to know wher

Re: Confused about CFRunLoop

2008-03-18 Thread Brian Greenstone
Actually, no. Not for games. For games we use the HID Manager for input which allows us to use more than just the keyboard and mouse. It allows for gamepads, steering wheels, tablets, etc, etc. The code doesn't even need to know where the input is coming from. The code can't tell the d

Re: Confused about CFRunLoop

2008-03-18 Thread Eric Schlegel
On Mar 18, 2008, at 6:41 AM, Brian Greenstone wrote: Works perfectly! It inserts my timer into the main run loop and processes everything as it should. Now I just need to figure out the CF equivalent of thos NSApplication calls and then I can be Obj- C free ;) If you want mouse and keyb

Re: Confused about CFRunLoop

2008-03-18 Thread Hamish Allan
On Tue, Mar 18, 2008 at 1:41 PM, Brian Greenstone <[EMAIL PROTECTED]> wrote: > Now I just need to figure out the > CF equivalent of thos NSApplication calls and then I can be Obj-C > free ;) You're asking in the wrong place. Perhaps try http://lists.apple.com/mailman/listinfo/carbon-dev ? Ham

Re: Confused about CFRunLoop

2008-03-18 Thread Brian Greenstone
Yay, I knew there was a way to do this, and I finally figured it out! Ok, so I'm able to emulate the Carbon calls exactly how I wanted by doing this: Step 1: Create the CF Timer... CFRunLoopTimerRef timer = CFRunLoopTimerCreate(...); CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer,

Re: Confused about CFRunLoop

2008-03-17 Thread Eric Schlegel
On Mar 17, 2008, at 7:53 PM, Brian Greenstone wrote: [[NSApplication sharedApplication] run]; That actually works! My timer fires off like it should, yet everything else works too. I can still access the menus, and window still receive click events. Unfortunately, there's no way

Re: Confused about CFRunLoop

2008-03-17 Thread Kyle Sluder
On Tue, Mar 18, 2008 at 12:01 AM, Brian Greenstone <[EMAIL PROTECTED]> wrote: > Cocoa is really only necessary for GUI based apps We seem to have not made any progress. Until you change that misconception, this is going to be rather difficult. Back when this OS was known as NEXTSTEP and Core Fou

Re: Confused about CFRunLoop

2008-03-17 Thread Rob Keniger
On 18/03/2008, at 2:04 PM, Rob Keniger wrote: Works great and it sounds like it will do what you want. The trick is to set the run loop mode correctly, you can probably do something equivalent with the CF calls if you like. I like my Obj-C gibberish so I avoid CF if possible ;-) I check

Re: Confused about CFRunLoop

2008-03-17 Thread Rob Keniger
On 18/03/2008, at 1:26 PM, Brian Greenstone wrote: I was using NSTimer originally, but I was having the exact same problem since NSTimer is really just a CFRunLoopTimerRef according to the docs. As far as I can tell, using NS calls to do this is just a more complicated way than simply cal

Re: Confused about CFRunLoop

2008-03-17 Thread Brian Greenstone
Cocoa is really only necessary for GUI based apps, but I'm doing games which are almost 99.9% custom code with no Mac OS X GUI. Ergo, I really don't have any need for Cocoa other than the basic window and OpenGL initialization. After that I just use Core Foundation for everything else. L

Re: Confused about CFRunLoop

2008-03-17 Thread Kyle Sluder
On Mon, Mar 17, 2008 at 11:26 PM, Brian Greenstone <[EMAIL PROTECTED]> wrote: > I was using NSTimer originally, but I was having the exact same > problem since NSTimer is really just a CFRunLoopTimerRef according to > the docs. As far as I can tell, using NS calls to do this is just a > more co

Re: Confused about CFRunLoop

2008-03-17 Thread Brian Greenstone
I was using NSTimer originally, but I was having the exact same problem since NSTimer is really just a CFRunLoopTimerRef according to the docs. As far as I can tell, using NS calls to do this is just a more complicated way than simply calling CF directly to do it without all that Obj-C gib

Re: Confused about CFRunLoop

2008-03-17 Thread Kyle Sluder
On Mon, Mar 17, 2008 at 10:53 PM, Brian Greenstone <[EMAIL PROTECTED]> wrote: > I'm trying to convert some old Carbon code over to Cocoa, and one of > the things I'm doing is converting my old run-loop timers. I used to > use the following code: Are you sure you want to be creating your own run