Welcome to MacForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Old school, coming back again.

 
   Macintosh computer (Home) -> Programmer Help RSS
Next:  open function hang on MacOS 10.5.1  
Author Message
Daniel T.

External


Since: Feb 26, 2008
Posts: 2



(Msg. 1) Posted: Tue Feb 26, 2008 5:53 am
Post subject: Old school, coming back again.
Archived from groups: comp>sys>mac>programmer>help (more info?)

I started programming for Mac back in the OS 5 days, through OS X
10.1, all the time using the (what is now called) the Carbon API.

Now my boss has asked me to write an application for "low end Macs".
I'm assuming that "low end" no longer means OS 9 or earlier, but it
would probably still mean programming for G4s and G5s wouldn't it?
Maybe G3s as well?

Also, the program is basically a port of a Windows (not MFC)
application that uses very little of the Toolbox (it's a kids video
game.) Would it still be appropriate to use the Carbon library, or do
I have to interface the C++ code to the Cocoa library?

Any other tips or tricks that an old dog can learn would be great to
hear as well. :-)

 >> Stay informed about: Old school, coming back again. 
Back to top
Login to vote
Gregory Weston1

External


Since: Oct 03, 2004
Posts: 1917



(Msg. 2) Posted: Tue Feb 26, 2008 12:44 pm
Post subject: Re: Old school, coming back again. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
"Daniel T." wrote:

> I started programming for Mac back in the OS 5 days, through OS X
> 10.1, all the time using the (what is now called) the Carbon API.
>
> Now my boss has asked me to write an application for "low end Macs".
> I'm assuming that "low end" no longer means OS 9 or earlier, but it
> would probably still mean programming for G4s and G5s wouldn't it?
> Maybe G3s as well?

Really depends on what your boss meant by that inherently ambiguous
statement.

> Also, the program is basically a port of a Windows (not MFC)
> application that uses very little of the Toolbox (it's a kids video
> game.) Would it still be appropriate to use the Carbon library, or do
> I have to interface the C++ code to the Cocoa library?

Erm. Even omitting MFC there are possibly Windows API calls and (worse)
reliance on certain compiler behaviors that would complicate reusing the
C++ code.

> Any other tips or tricks that an old dog can learn would be great to
> hear as well. :-)

Really it depends on the details of the programming assignment. What are
the target hardware and OS versions, and what's the real nature of the
existing code. Although an extreme case, it's theoretically possible
that your best option is to learn Cocoa and rewrite from the ground up.

 >> Stay informed about: Old school, coming back again. 
Back to top
Login to vote
noreply

External


Since: Dec 02, 2004
Posts: 160



(Msg. 3) Posted: Tue Feb 26, 2008 12:45 pm
Post subject: Re: Old school, coming back again. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Daniel T. wrote:

> I started programming for Mac back in the OS 5 days, through OS X
> 10.1, all the time using the (what is now called) the Carbon API.
>
> Now my boss has asked me to write an application for "low end Macs".
> I'm assuming that "low end" no longer means OS 9 or earlier, but it
> would probably still mean programming for G4s and G5s wouldn't it?
> Maybe G3s as well?

Only your boss knows for sure (hopefully!) but I guess nowadays 'low end
Mac' means: support for Mac OS X 10.3.9. You would do this by creating a
universal binary app that targets the 10.3.9 SDK for PPC Macs and the
10.4u SDK for intel Macs. You don't need to whorry about processor types
for your kind of application.

> Also, the program is basically a port of a Windows (not MFC)
> application that uses very little of the Toolbox (it's a kids video
> game.) Would it still be appropriate to use the Carbon library, or do
> I have to interface the C++ code to the Cocoa library?

Carbon is still a valid technology and, considering your experience,
may be the fastest route to a working port. However, if you want to
prepare yourself for the future using Cocoa is going to be a more
valueable experience. You can easilly integrate C++ code using
'Objective-C++'.

patrick
 >> Stay informed about: Old school, coming back again. 
Back to top
Login to vote
Daniel T.

External


Since: Feb 26, 2008
Posts: 2



(Msg. 4) Posted: Tue Feb 26, 2008 1:01 pm
Post subject: Re: Old school, coming back again. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Feb 26, 12:44 pm, Gregory Weston wrote:
> In article
> ,
>  "Daniel T." wrote:
>
> > I started programming for Mac back in the OS 5 days, through OS X
> > 10.1, all the time using the (what is now called) the Carbon API.
>
> > Now my boss has asked me to write an application for "low end Macs".
> > I'm assuming that "low end" no longer means OS 9 or earlier, but it
> > would probably still mean programming for G4s and G5s wouldn't it?
> > Maybe G3s as well?
>
> Really depends on what your boss meant by that inherently ambiguous
> statement.
>
> > Also, the program is basically a port of a Windows (not MFC)
> > application that uses very little of the Toolbox (it's a kids video
> > game.) Would it still be appropriate to use the Carbon library, or do
> > I have to interface the C++ code to the Cocoa library?
>
> Erm. Even omitting MFC there are possibly Windows API calls and (worse)
> reliance on certain compiler behaviors that would complicate reusing the
> C++ code.
>
> > Any other tips or tricks that an old dog can learn would be great to
> > hear as well. :-)
>
> Really it depends on the details of the programming assignment. What are
> the target hardware and OS versions, and what's the real nature of the
> existing code. Although an extreme case, it's theoretically possible
> that your best option is to learn Cocoa and rewrite from the ground up.

We use a propitary framework that I ported before. Aparently the code
was lost so I would have to re-port the framework. :-(

Developing from the ground up is not an option (management reasons.)
All interface elements are custom (no API calls for buttons and such.)
Before, I just opened a window and drew directly into it (just like
the Windows verson does,) and used WaitNextEvent to handle input.
 >> Stay informed about: Old school, coming back again. 
Back to top
Login to vote
Chris Hanson

External


Since: Apr 30, 2004
Posts: 61



(Msg. 5) Posted: Tue Feb 26, 2008 4:18 pm
Post subject: Re: Old school, coming back again. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-02-26 07:16:00 -0800, noreply.DeleteThis@mail.invalid (Patrick Machielse) said:

> Only your boss knows for sure (hopefully!) but I guess nowadays 'low end
> Mac' means: support for Mac OS X 10.3.9. You would do this by creating a
> universal binary app that targets the 10.3.9 SDK for PPC Macs and the
> 10.4u SDK for intel Macs.

No, no, no, no, NO. People keep saying this and it's *not true*. Please stop.

You can use the Mac OS X 10.5 SDK if you want to and *still* target
10.3.9 on PowerPC hardware and 10.4.3 on Intel hardware. The SDK only
determines the maximum version of Mac OS X from which you can use
features.

To ensure your software can *run* on Mac OS X 10.3.9 on PowerPC
machines, you need to set your Mac OS X Deployment Target to 10.3 when
building for PowerPC, and avoid using any new-in-10.4 (or later) APIs.
That's it. You don't have to do development on Tiger, you don't have
to use the 10.3.9 SDK, you don't have to use Xcode 2.5, you don't have
to use GCC 3.3.

The only reason you need to use a GCC earlier than GCC 4 is to run C++
code on an OS earlier than 10.3.9.

To summarize:

SDK = maximum version of the OS from which you want to use features
Deployment Target = minimum version of the OS on which you want to run
Compiler version = GCC 4.0 or later for 10.3.9 or above will work fine

Hope this helps.

-- Chris
 >> Stay informed about: Old school, coming back again. 
Back to top
Login to vote
Reinder Verlinde

External


Since: Feb 18, 2004
Posts: 128



(Msg. 6) Posted: Tue Feb 26, 2008 7:16 pm
Post subject: Re: Old school, coming back again. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
"Daniel T." wrote:

> On Feb 26, 12:44 pm, Gregory Weston wrote:
> > In article
> > ,
> >  "Daniel T." wrote:
> >
> > > Now my boss has asked me to write an application for "low end Macs".
> > > I'm assuming that "low end" no longer means OS 9 or earlier, but it
> > > would probably still mean programming for G4s and G5s wouldn't it?
> > > Maybe G3s as well?
>
> We use a propitary framework that I ported before. Aparently the code
> was lost so I would have to re-port the framework. :-(
>
> Developing from the ground up is not an option (management reasons.)
> All interface elements are custom (no API calls for buttons and such.)
> Before, I just opened a window and drew directly into it (just like
> the Windows verson does,) and used WaitNextEvent to handle input.

You should consider OpenGL
<http://developer.apple.com/graphicsimaging/opengl/> and GLUT
<http://www.opengl.org/documentation/specs/glut/spec3/spec3.html>. That
might lead to a code base that is largely shared between platforms.

Reinder
 >> Stay informed about: Old school, coming back again. 
Back to top
Login to vote
noreply

External


Since: Dec 02, 2004
Posts: 160



(Msg. 7) Posted: Wed Feb 27, 2008 1:42 pm
Post subject: Re: Old school, coming back again. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Chris Hanson wrote:

> On 2008-02-26 07:16:00 -0800, noreply DeleteThis @mail.invalid (Patrick Machielse) said:
>
> > Only your boss knows for sure (hopefully!) but I guess nowadays 'low end
> > Mac' means: support for Mac OS X 10.3.9. You would do this by creating a
> > universal binary app that targets the 10.3.9 SDK for PPC Macs and the
> > 10.4u SDK for intel Macs.
>
> No, no, no, no, NO. People keep saying this and it's *not true*. Please
> stop.

relax.

> To ensure your software can *run* on Mac OS X 10.3.9 on PowerPC
> machines, you need to set your Mac OS X Deployment Target to 10.3 when
> building for PowerPC, and avoid using any new-in-10.4 (or later) APIs.
> That's it.

Yes, that works. However, in practice this means that it's all too easy
to build a product that *won't run* on older systems. The availability
macro's are a fine mechanism (and should be used), but they don't
provide full coverage:

- Not even all Cocoa frameworks use it (f.i. WebKit). Availability is
mostly mentioned in the documentation.

- Most lower level libraries don't use it (f.i. OpenGL). Availability
can be determined only from the SDK headers.

In my opinion, the best advise to the original poster is to use matching
SDK and Deployment Target settings. This will detect unavailable symbols
at the earliest possible stage. Using a newer SDK with an older
deployment target is an advanced technique that allows one to take
advantage of newer API at the expense of hiding availability conflicts
for older targets.

I say this based on my own experience and reading Apple documentation
such as the weak linking technote (5 years old by now, but "check back
here periodically for updates on tools and OS support"). If I missed
some important aspect, or if you can share more up-to date inside
information on the subject, I would certainly be interested.

patrick
 >> Stay informed about: Old school, coming back again. 
Back to top
Login to vote
gandreas

External


Since: Feb 27, 2008
Posts: 1



(Msg. 8) Posted: Wed Feb 27, 2008 1:42 pm
Post subject: Re: Old school, coming back again. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-02-27 07:48:31 -0600, noreply.RemoveThis@mail.invalid (Patrick Machielse) said:

> Chris Hanson wrote:
>> To ensure your software can *run* on Mac OS X 10.3.9 on PowerPC
>> machines, you need to set your Mac OS X Deployment Target to 10.3 when
>> building for PowerPC, and avoid using any new-in-10.4 (or later) APIs.
>> That's it.
>
> Yes, that works. However, in practice this means that it's all too easy
> to build a product that *won't run* on older systems. The availability
> macro's are a fine mechanism (and should be used), but they don't
> provide full coverage:
>
> - Not even all Cocoa frameworks use it (f.i. WebKit). Availability is
> mostly mentioned in the documentation.


The problem here is that WebKit is not tied to the OS. It's tied to
what version of Safari is installed, which is sort of tied to the OS
but only indirectly (so for example, Safari 3.0 features found in 10.5
are available on 10.4, but only 10.4.11 or later). As a result,
there's no practical way to use the availability macros like this.

The Quicktime features are even worse...


>
> - Most lower level libraries don't use it (f.i. OpenGL). Availability
> can be determined only from the SDK headers.

OpenGL provides its own (cross platform-ish) way of determining what
features are available (which are ultimately tied to the display card
and drivers)

>
> In my opinion, the best advise to the original poster is to use matching
> SDK and Deployment Target settings. This will detect unavailable symbols
> at the earliest possible stage. Using a newer SDK with an older
> deployment target is an advanced technique that allows one to take
> advantage of newer API at the expense of hiding availability conflicts
> for older targets.

It is, however, the "recommended" way to do things. For example, from
<http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/UniversalBinaries/chapter_4_section_1.html>:

To

support versions of Mac OS X prior to Mac OS X v10.4 for PowerPC, you
can specify separate deployment OS versions for Intel and PowerPC-based
builds. To do so, use the per-architecture variants of the
MACOSX_DEPLOYMENT_TARGET build setting
 >> Stay informed about: Old school, coming back again. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
old school offscreen graphics - Hello, I've been here some months ago with my questions about System-6 compatible C programming, on various topics. I'm currently very close to having a very useful function which sets a BitMap memory space and draws graphics in it, off the screen, so..

Old school (?) drawing philosophy - I finally have a serviceable 2d image drawing engine working under System 1.0 through OS 9.2. I can draw arbitrary sized multi-frames sprites, with (pre-generated) white masks, if needed, and with auto-cleaning (saves background in temp bitmap and draws....

need help debugging old school BASIC program - this basic program (simple poetry-generating program) keeps giving me errors. I'm using the free Chipmunk Basic on OSX. Any help apprectiated.. 10 rem hanshan 20 gosub 250 : rem initialize 30 rem choose pattern 40 r = int(rnd(1)*3)+1 50 on r gosub..

RE: need help debugging old school BASIC program - 10 rem hanshan 20 gosub 250 : rem initialize 30 rem choose pattern 40 r = int(rnd(1)*3)+1 50 on r gosub 90,140,190 60 for t = 1 to 2500 : next t 70 print : print : print 80 goto 40 90 rem ** pattern one ** 100 color 14 : print..

new handles coming up after calling InitializeQTML () - Hi guys, I have little problem with QuickTime on windows, when I call InitializeQTML (0) new handles start popping up - it is approximately two new handles per second and it's still counting. I'm using current Qt SDK called from MSVC 6.0, QuickTime..
   Macintosh computer (Home) -> Programmer Help All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]