OS X Compile Solution (pre-10.6)

OK, as I promised, I grabbed the tip and attempted a compile. This was on a 10.6 box, but with everything set to generate ONLY for the 10.4 SDK. This same thing should work for the 10.5 SDK. Does it make a good library? I have no idea, I only got it to compile.

The problem: The “touch” interface is 10.6 only.

The solution:

(Note: line numbers of approximate because they moved after I added lines, obviously – check the code.)=======================================================================================================================

Duplicated the “Deployment_for_official_releases_using_10.4SDK_and_10.6SDK” to create

Made these changes to target:
Architecture to 32 bit universal
(this eliminated the 10.6 calls as they are 64 bit intel – getting the 64 bit build back is just a little bit more work but I skipped it for now)
Added SDL_OSX_DISABLE_TOUCH=1 to preprocessor macros for my new target
(obviously) set project to this target.

Then I added some ifndefs in two pieces of code:

In the file “SDL_cocoawindow.h”:

around line 67:

-(void) touchesBeganWithEvent:(NSEvent *) theEvent;
-(void) touchesMovedWithEvent:(NSEvent *) theEvent;
-(void) touchesEndedWithEvent:(NSEvent *) theEvent;
-(void) touchesCancelledWithEvent:(NSEvent *) theEvent;

around line 81:

-(void) handleTouches:(cocoaTouchType)type withEvent:(NSEvent*) event;

In the file SDL_cocoawindow.m

around line 65:

[[_data->nswindow contentView] setAcceptsTouchEvents:YES];

around line 277:


  • (void)touchesBeganWithEvent:(NSEvent *) theEvent
    [self handleTouches:COCOA_TOUCH_DOWN withEvent:theEvent];

… (go down to around 364, at the end of the handleTouches function)

    touch = (NSTouch*)[enumerator nextObject];





This allows it to compile and build.

NOW: Why is it including X11 files in the compile? Is this necessary? If so, why? If not, this also needs to be cleaned up.

NEXT: What to do about the touch interface? Should there be a 10.6 only and 10.4 compile? This might be the best way to handle this, but it’s not my project so I’m only laying that out there.

[>] Brian