Dx counterparts

LWStrike
Unregistered
 
Post: #1
Hello, i am new to mac.

I would like to know what the directX counterpart of mac. What API do i use to get input, draw video (in windowed and fullscreen) and play sound. I rather learn what OS X uses nativly right now instead of a lib like SDL which hides and mixes all the features from you.

First thing i want to do is get my USB joypad working. Any link to sample code would be nice too but all i need is the API name to look up.
Quote this message in a reply
Moderator
Posts: 3,573
Joined: 2003.06
Post: #2
OpenGL is the counterpart to Direct3D. You'll want to use OpenAL for audio. You'll be looking to the HID manager for specific USB input like for a gamepad. Be warned however, the HID manager is a disaster with plenty of buginess, and is not for the timid to learn how to use; not impossible, but not fun either. I should also note that there isn't anything wrong with using SDL - it is very popular around here. If you still want to avoid using SDL or GLUT, you will have to use a system API as well - either Carbon or Cocoa. I would venture to guess that the majority of newcomers estimate that since Carbon is more like Windows API they go that route. However, I would say that the majority of the developers here use Cocoa, which is the preferred API for all of Apple's new whiz-bang interface stuff. It is very nice to work with, and I highly recommend it, but it is based on Objective-C, so you'll have to spend a week or two learning to get into it. It is well worth the effort however. The absolute quickest way to get up and running with OpenGL graphics and basic input on the Mac is GLUT. You can also check out the Carbon or Cocoa NeHe ports at http://nehe.gamedev.net/. Good luck!
Quote this message in a reply
LWStrike
Unregistered
 
Post: #3
Since OpenAL is cross platfrom i assume it is using a MacOSX API.
HID looks kind of nasty, i'll give it a try though. I'll probally be messing with hardware sooner or later.
I know OpenGL is an alternative to d3d, but is there a specificly 2d API i can use for any macs that dont have 3d hardware? I may not support anything older then OSX so does anyone know if osx runs on a machine without 3d hardware?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
There are a couple of Mac models which are capable of running Mac OS X which don't have hardware acceleration, but they're so ancient that nobody worries about them these days.

As far as I know, there is no 2D acceleration on Mac OS X. OpenGL is the API to use for all graphics which favor speed over quality.

OpenAL uses CoreAudio underneath, but you *really* don't want to go there. OpenAL is the API Apple recommends to game developers.

I really don't see what the point is of programming that close to the OS. If SDL does what you need, it'll certainly do it more easily than these more generic APIs. Why not take advantage of that, and keep your code cross-platform at the same time?
Quote this message in a reply
Member
Posts: 715
Joined: 2003.04
Post: #5
LWStrike Wrote:Since OpenAL is cross platfrom i assume it is using a MacOSX API.
HID looks kind of nasty, i'll give it a try though. I'll probally be messing with hardware sooner or later.
I know OpenGL is an alternative to d3d, but is there a specificly 2d API i can use for any macs that dont have 3d hardware? I may not support anything older then OSX so does anyone know if osx runs on a machine without 3d hardware?

Mac osx runs on no computers without 3D hardware.
All macs going back to 1998 or so had some 3D video card,
although back then they were pretty feeble.
If you are developing for OSX you're lowest target machine at this time
is 450 mhz or higher, running OS X 10.3.9 or 10.4, and probably 10.5
by June or September. 450mhz is really the LOWEST, as any machine at that
speed is already about six years old.


Of course you also have to consider Intel chipset now a days,
since getting my core duo imac, alot of carbon programs refuse
to open, and other programs built for OS X below 10.4 just crash.

Oh and you can do all kinds of 2D in openGL, don't worry about that.
Quote this message in a reply
Moderator
Posts: 508
Joined: 2002.09
Post: #6
igame3d Wrote:450mhz is really the LOWEST, as any machine at that
speed is already about six years old.

Not quite. I still have my Rev D iMac which runs at 333Mhz. It has Panther installed and works very well. Sure it doesn't run hardware accelerated games, but it can run OpenGL and 2D games at acceptable speed.

"When you dream, there are no rules..."
Quote this message in a reply
Member
Posts: 715
Joined: 2003.04
Post: #7
Taxxodium Wrote:Not quite. I still have my Rev D iMac which runs at 333Mhz. It has Panther installed and works very well. Sure it doesn't run hardware accelerated games, but it can run OpenGL and 2D games at acceptable speed.

But most likely can't run OS 10.4 or above, and turned seven years old in January.
One good thing, if you are going to dev for this model, you can get it
on ebay for like $50 or less.

I have a B/W G3 350 thats been collecting dust for a year, poor thing.
Quote this message in a reply
Moderator
Posts: 3,573
Joined: 2003.06
Post: #8
> Mac osx runs on no computers without 3D hardware.

I had an original bondi blue iMac up until last year that ran Panther rather well, and it did not have hardware acceleration. I gave it away to the needy because it wasn't very useful without it.

> 450mhz is really the LOWEST, as any machine at that speed is already about six years old.

I'm with Taxxodium on that one, if we're into splitting hairs. I still have a 300 Mhz B&W G3 in active service for email and web browsing (and software testing of course) in the living room. I don't make special effort to develop for the Rage 128 anymore, which is standard in that Mac, but I do use a Radeon 7000 in it which is a little easier to develop down to. I would call the 300 Mhz B&W the rock bottom limit of what *could* possibly be developed for, but if you list that in your requirements, then you need to develop for the Rage 128. Below the 300 Mhz B&W are the beige G3's, which as I recall used the ATI, what was it?, Rage Pro? I remember it wasn't anywhere near as good as the Rage 128's that were used starting with the B&W series. Doesn't matter anyway though, since the B&W 300 was min spec for OS X. I also remember many AAA games at the time that listed the B&W 300 as the minimum spec. Really though, if all you're doing is a decent 2D game, the B&W 300 with a Rage 128 is perfectly capable of holding its own. It'll do 3D easily up to Quake3 class. Those were great machines. Like I said, mine is still kicking... At least for another week or two before I pick up my new Mac Mini. I think I'm going to take my B&W out of service after all these years. It'll be gathering dust like yours soon... Kinda sad to think about...

All that being said, I wouldn't seriously consider developing for anything less than a one gig G4, or dual 867, with at least a GeForce4 MX or better, nowadays. And personally, I wouldn't support anything less than the latest OS. It's a pretty cheap upgrade in reality, and for the one-man show I think it often-times just adds more challenge than reward to support older stuff. It's a nice and noble thought, but I think it lacks practicality.
Quote this message in a reply
Moderator
Posts: 508
Joined: 2002.09
Post: #9
igame3d Wrote:But most likely can't run OS 10.4 or above, and turned seven years old in January.

It can, but I can't install it because I don't have a DVD drive for the iMac, and target mode won't work as the iMac doesn't have firewire. Then there's the why should I bother question. The iMac is not in use so...

"When you dream, there are no rules..."
Quote this message in a reply
Member
Posts: 715
Joined: 2003.04
Post: #10
AnotherJake Wrote:> Below the 300 Mhz B&W are the beige G3's, which as I recall used the ATI, what was it?, Rage Pro?
ATI 3D Rage II+DVD or ATI Rage Pro-PCI
Between 2 and 6 mb of VRAM.

BTW, there are 55 Mac different models with the G4.
16 Mac models so far have Tiger (10.5) installed by default.

I expect an OS update announcement at or before WWDC in August,
as Tiger will be a year old next month.
Isn't Windows XP like five years old now? Man talk about milking it!
Quote this message in a reply
Moderator
Posts: 508
Joined: 2002.09
Post: #11
Tiger is 10.4 Rasp

And yes, Apple will say something about Leopard (10.5) at WWDC on August. Very exiting times..

I wonder if they'll do something on April 1st, other than have a good joke on us Rasp

"When you dream, there are no rules..."
Quote this message in a reply
LWStrike
Unregistered
 
Post: #12
igame3d i rather not upgrade my OS every year Rasp, i like the idea of upgrading once every 4 years.

Thanks for all that info. I think i'll target 500mhz, 64mb as the rock bottem (my older PC) and full preformance on an intel mini (whats with the shared ram).

Allright OneSadCookie, i'll take your word and not use CoreAudio. I think i heard bad things about it but that was months before i knew what it was.
Quote this message in a reply
Moderator
Posts: 3,573
Joined: 2003.06
Post: #13
> ATI 3D Rage II+DVD or ATI Rage Pro-PCI

Ah, yes, that's right. Thank you. I remember I did a video RAM upgrade in my Beige G3 233 to 6 MB and it didn't really do a darn thing for performance. The specs on the B&Ws were so much more impressive that I bought one just a year after buying the Beige. It was indeed a huge boost in connectivity with USB and Firewire, video acceleration, and just raw computing power, harrr! Worth every penny...

> BTW, there are 55 Mac different models with the G4.

Interesting, I didn't realize they had been cranking out so many of them.

> 16 Mac models so far have Tiger (10.4)[corrected] installed by default.

Those 16 models include the G5's and Intel's I assume. I should retract what I said about not supporting *anything* less than the latest. After thinking about it for a second, I just remembered that I don't actually push friends to update to Tiger nearly as much as at least having 10.3. I remember we've had some discussion about this in the past here at iDG, but I don't remember the generally agreed upon `oldest practical version to support for OGL compatibility'. 10.2.8 comes to mind, but don't quote me on that. Personally, I still find 10.3 is plenty pleasing enough to work with, which is what I have installed on my living-room B&W I mentioned earlier.

> I expect an OS update announcement at or before WWDC in August,
as Tiger will be a year old next month.

That would definitely be a reasonable expectation, considering Steve announced that they'd be working on it since last year, but wouldn't talk about it anymore than it's name until later in the future. Well, the future is almost a year later now, so...
Quote this message in a reply
Moderator
Posts: 3,573
Joined: 2003.06
Post: #14
Sorry, I dislike double posting, but I just missed LWStrike while I was previewing the last one...

> igame3d i rather not upgrade my OS every year , i like the idea of upgrading once every 4 years.

I like the two year cycle that Apple has going for OS X upgrades. There was a release, I think of Panther, that was only like 18 months after the previous one and that kind of bugged me. My four year cycle is reserved for hardware upgrades. Of course it all depends on what kind of cash happens to be available at any given time. Wink

> I think i'll target 500mhz, 64mb as the rock bottem (my older PC) and full preformance on an intel mini

That's a lofty goal, but good luck. It's hard to stretch compatibility out that far with high performance graphics. Especially when you get so used to them on your development machine, which is invariably the fast one. A lot of us around here don't really worry too much about the processor speed as much as the video card capabilities. For instance, anything above a Rage 128 can do rectangle textures, which is pretty convenient.

> (whats with the shared ram)

Pretty much everybody seems to agree that it's a little funky of Apple to have done that, but we'll see how it works out. Apparently they did it for price and because it was easier to fit in the Mini form factor with the new Intels. Who knows? I would bet it will work out fine for most purposes. The only thing that I'm terribly concerned about is the apparent lack of vertex shader support.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #15
The Intel GMA 950 doesn't do hardware vertex processing, it's true, but that doesn't mean you don't have access to vertex shaders -- they just run in software, which should be plenty fast enough for most applications.

I think most people around here doing graphically intensive stuff are developing for 10.3.9 and ignoring any computer that doesn't have at least a GeForce 2MX or a Radeon. That gives you access to ARB_texture_rectangle, ARB_texture_cube_map, etc, which is handy. If you're just making solitaire or whatever, sure, go for Rage 128 and 10.2.8 support if it makes you happy.

http://update.omnigroup.com has some interesting statistics.
Quote this message in a reply
Post Reply