New to Carbon, need help plz...

BlueAvian
Unregistered
 
Post: #1
I first started programming with Flash, and have finally worked my way up to Carbon, (Cocoa is in the works). But what I need to learn now is exactly how to do frame rates and work with open GL on a mostly 2d level. Right now I have been using timed events to do the frame rate, and only been using QuickTime. If someone could help me on this, please do.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #2
First of all I assume you know C or C++? If you plan on learning Cocoa I would advise you just stop learning Carbon and move onto Cocoa. Cocoa is easier to setup and get things running than Carbon. And if you're only interested in learning how to program games then I would suggest using SDL instead of either Carbon/Cocoa. SDL will allow you code games and learning OpenGL without having to mess with Cocoa or Carbon. SDL is based on Cocoa. HTH
Quote this message in a reply
DCoder
Unregistered
 
Post: #3
Quote:Originally posted by BlueAvian
...what I need to learn now is exactly how to do frame rates and work with open GL on a mostly 2d level. Right now I have been using timed events to do the frame rate, and only been using QuickTime. If someone could help me on this, please do.

First, check out this thread if you haven't already. Then check out the NeHe tutorials on OpenGL or the Cone3d tutorials on SDL.

But, fundamentally, Carbon or Cocoa are just frameworks. A framework is a fancy Apple-word (in this context) that means class library. Ultimately you'll care about learning C, C++, ObjectiveC, or Java. If you are looking to develop games/software using OpenGL, there are Carbon- and Cocoa- centric contexts for doing so, as well as GLUT, which may or may not be suitable for your purposes. Keep in mind that Apple has an extensive set of OpenGL features in their AGL library (which is Carbon and/or CoreFoundation (C/++)based). Also, OpenGL is written in C, and is architecturally built as a large state machine / rendering pipeline. You would do well to get a copy of the "Red Book" -- which is the golden standard for learning OpenGL from the horse's mouth.

To answer your question, I would recommend you check out SDL tutorial which has sprites that perform frame-rate independent movement. And also, read this article which is specifically about the math used to perform frame-rate independent movement. For specific Mac OpenGL information, check out this post which links to some tutorial information.

Good luck.

Quote:Originally posted by Mars_999
...if you're only interested in learning how to program games then I would suggest using SDL instead of either Carbon/Cocoa. SDL will allow you code games and learning OpenGL without having to mess with Cocoa or Carbon. SDL is based on Cocoa.


Careful Wink

SDL is not based on Cocoa. SDL is pure C, eventhough it strongly resembles an OO layout. Darrell Walliser (sp?) has been gracious enough to spend a huge amount of time with the SDL team so that SDL applications can be easily developed in ProjectBuilder -- to the extent that the SDL PBProject does include NIBs and .m files for developing ObjectiveC apps. Another very nice feature of SDL is its integration with OpenGL, although if you are going the OGL-route, I would probably recommend skipping SDL and using the MacOS APIs unless you're looking for cross-platform functionality.

-daniel
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
What Mars999 meant is that SDL for Mac OS X is implemented using Cocoa, which is true.
Quote this message in a reply
AJ Infinity
Unregistered
 
Post: #5
Quote:Originally posted by BlueAvian
I first started programming with Flash, and have finally worked my way up to Carbon, (Cocoa is in the works). But what I need to learn now is exactly how to do frame rates and work with open GL on a mostly 2d level. Right now I have been using timed events to do the frame rate, and only been using QuickTime. If someone could help me on this, please do.


TRAITOR!!! Lost your FlashGeek-ness? Same here, just not all the way. I could email you an *excellent* tutorial on how to program in Cocoa/ObjectiveC++. Cocoa is a bit easier than Carbon for me. I tried to learn C/Carbon a while back but my bead experience made me not want to ever use Carbon again. So I started using Flash. Anyway, now I've got two 3D Director web games in development for Shockwave.com, plus a TCG for Miniclip.com. BlueAvian, are you aware you can be PAID for web games you do for major sites (such as Shockwave)? Paid, I said paid.

Anyway, I'll email you my copy of "The Red Book" and also a PDF on ObjectiveC++ programming. And, definitely, get some tutorials from NeHe

I recommend Cocoa over Carbon.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #6
Quote:Originally posted by DCoder
First, check out this thread if you haven't already. Then check out the [b]NeHe tutorials on OpenGL or the Cone3d tutorials on SDL.

But, fundamentally, Carbon or Cocoa are just frameworks. A framework is a fancy Apple-word (in this context) that means class library. Ultimately you'll care about learning C, C++, ObjectiveC, or Java. If you are looking to develop games/software using OpenGL, there are Carbon- and Cocoa- centric contexts for doing so, as well as GLUT, which may or may not be suitable for your purposes. Keep in mind that Apple has an extensive set of OpenGL features in their AGL library (which is Carbon and/or CoreFoundation (C/++)based). Also, OpenGL is written in C, and is architecturally built as a large state machine / rendering pipeline. You would do well to get a copy of the "Red Book" -- which is the golden standard for learning OpenGL from the horse's mouth.

To answer your question, I would recommend you check out SDL tutorial which has sprites that perform frame-rate independent movement. And also, read this article which is specifically about the math used to perform frame-rate independent movement. For specific Mac OpenGL information, check out this post which links to some tutorial information.

Good luck.



Careful Wink

SDL is not based on Cocoa. SDL is pure C, eventhough it strongly resembles an OO layout. Darrell Walliser (sp?) has been gracious enough to spend a huge amount of time with the SDL team so that SDL applications can be easily developed in ProjectBuilder -- to the extent that the SDL PBProject does include NIBs and .m files for developing ObjectiveC apps. Another very nice feature of SDL is its integration with OpenGL, although if you are going the OGL-route, I would probably recommend skipping SDL and using the MacOS APIs unless you're looking for cross-platform functionality.

-daniel [/b]


Yes you're correct SDL is based on C, but in his context he was asking about Carbon or Cocoa? So I said SDL is based on Cocoa not the Carbon framework. What I am trying to do is persuade him to use Cocoa. Grin
Quote this message in a reply
DCoder
Unregistered
 
Post: #7
Quote:Originally posted by Mars_999
What I am trying to do is persuade him to use Cocoa.


Oh. Yeah. Definitely go with Cocoa. Carbon is for weenies who can't deal with dynamic typing!

-daniel

Grin
Quote this message in a reply
AJ Infinity
Unregistered
 
Post: #8
hehehe...that is true. Chase, since you used to work in Flash, you'll prefer Cocoa (easy UI creation, dynamic typing, event handling that's similar to Flash and Director, etc.).
Quote this message in a reply
BlueAvian
Unregistered
 
Post: #9
Thx guys for the feedback. I have decided to go to Cocoa. Even if it wasn't for this thread I would have eventually gotten there. Well after reading a bit into the books I got I see the major potential in Cocoa. And the Objects and casses will majorly help me in my intrest of Genetic Programming. Thx all.

Chase
Quote this message in a reply
Post Reply