Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > C++ in Cocoa (and ScreenSavers)

C++ in Cocoa (and ScreenSavers)
Thread Tools
Junior Member
Join Date: Dec 2000
Location: Boston, MA USA
Status: Offline
Reply With Quote
Mar 30, 2001, 08:15 PM
 
My apologies if this has been covered already... forum searching doesn't seem to be working right now.

Can I include any C++ code at all in a Cocoa project? Or do I have to use Objective-C for everything? I'm trying to port an OpenGL project of mine to a screensaver in OS X. I have it running well under GLUT in Carbon, but it looks like I have to go with Cocoa to write a screen saver plug-in. All the samples I could find use only plain C, no C++. My project uses C++ heavily for class structures. I plan to learn Objective-C eventually, so rewriting the code in Obj-C is a possibility, but one of my goals for the project was to make the code extremely portable (since it is 99% platform independent OpenGL code) and compile with little modification in Mac, Windows, Linux, whatever.

Any ideas? Thanks in advance,
- Ross
     
Mac Boy  (op)
Junior Member
Join Date: Dec 2000
Location: Boston, MA USA
Status: Offline
Reply With Quote
Mar 31, 2001, 12:49 AM
 
Just found this myself in case anyone else had the same question:
http://developer.apple.com/samplecod...bon_or_C__.htm

- Ross
     
Senior User
Join Date: Feb 2001
Location: Rochester, uk
Status: Offline
Reply With Quote
Mar 31, 2001, 11:00 AM
 
Objective-C is just as cross-platform as C++. It's only the Apple/Next libraries, ie Cocoa, that aren't portable (yet).

All words are lies. Including these ones.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:54 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2