Sdl, X11, Os X...

5thPeriodProductions
Unregistered
 
Post: #1
I seem to remember reading that libsdl.org Mac OS X libraries are meant for Aqua use, and not X11. Now, I haven't started any sort of SDL development (for a lot of reasons), so I thought I'd make sure I knew what I could and couldn't do first.

I'm interested in teaming up with a number of friends to develop cross-platform games (we have OS X, Windows and Linux access between us), so I thought SDL and OpenGL would be good choices.

I'd like to work with Objective C, simply because I like it and it makes some sense to me, but it's not world-ending if I'm forced to use C and C++.

What's the deal with OpenAL? Doesn't SDL handle audio?

Yes, these are newbie questions. But, guess what, I'm a newbie. Oh, and 5thPeriodProductions = WaaMatt (used to post here under that name).
Quote this message in a reply
Moderator
Posts: 702
Joined: 2002.04
Post: #2
Eh, why would SDL support X11 on Mac OS X when X11 is an optional package? As for your audio issues, I'd suggest you take a look a SDL_mixer.

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
You can build SDL for X11 on Mac OS X if you want to, though I don't know why you would. The native port works perfectly well.

You can use ObjC on all the platforms, but you don't get any Cocoa with it, and it forces you to use GCC on all the platforms, which probably won't go down too well with your friends Wink

SDL has its own audio (SDL_mixer) but OpenAL is also a good choice, and potentially hardware-accelerated if the user has audio hardware.
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #4
SDL can handle audio itself without any extra libraries, but you're obliged to mix the audio yourself. That's potentially quite technical, although you can do anything you like with it that way.

To make life easier for people who don't know how to mix audio, SDL_mixer offers a much simpler API. As its name suggests, SDL_mixer can mix audio files to produce multi-channel sound. It's quite easy to use, but it's also rather limited. For example, you can't do a pitch bend (or at any rate, you couldn't the last time I looked). You could still write and plug in your own mixer effects, though.

OpenAL, on the other hand, has all sorts of features built in, including reverb and spatial 3D effects. I haven't tried OpenAL myself, but from what I can gather it's an OpenGL-style state machine, and I would imagine it's somewhat more complex than SDL_mixer.

If you want an easy life, start with SDL_mixer. If you want to dive in and prepare to do something sophisticated, try OpenAL.

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
5thPeriodProductions
Unregistered
 
Post: #5
Ah, I'd definitely like to start off simpler.

The reason I'd want to use a non-Aqua windowing system is for ease of porting. I'd rather not have three different versions of the code to accomodate a Mac windowing system, a Windows windowing system, and a *nix windowing system.

Thanks for the feedback on the differences of SDL's audio capabilities and OpenAL. I think OpenAL is a great idea for the future of my developing and coding capabilities - I have a history of working with sound and effects (ah, SoundEdit 16...).
Quote this message in a reply
Moderator
Posts: 702
Joined: 2002.04
Post: #6
I'm curious as to what you mean when you state you would need to 'accomodate' the windowing systems of the three platforms, as SDL already has the capability for creating OGL contexts..?

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #7
5thPeriodProductions Wrote:The reason I'd want to use a non-Aqua windowing system is for ease of porting. I'd rather not have three different versions of the code to accomodate a Mac windowing system, a Windows windowing system, and a *nix windowing system.
In theory, code written for SDL should be mostly the same on OSX, Windows and *nix. That's the whole point of SDL. As such, you're almost certainly better off using the native version of SDL on OSX rather than the X11 version. I mean, no-one uses X11 apps on OSX unless they absolutely have to....

Typically, if you're using SDL you are specifically not using a window system. SDL is designed to produce a fullscreen display or a single window, and it doesn't have anything much to do with any other GUI features such as menus and buttons. If you need these features, you probably don't want to use SDL.

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #8
OneSadCookie Wrote:You can use ObjC on all the platforms, but you don't get any Cocoa with it, and it forces you to use GCC on all the platforms, which probably won't go down too well with your friends.
I was under the impression windows gcc only supported C/C++ Huh

It's not magic, it's Ruby.
Quote this message in a reply
Member
Posts: 116
Joined: 2005.02
Post: #9
I can't get any X11 apps to work (meaning I don't know how to use X11)...btw, does anyone have a link to SDL_image? Getting it from Fink didn't work too well during install while installing from source. It was missing all of the headers...

Last login: Sat Aug 6 09:15:05 on console
Welcome to Darwin!
Matt-Chelens-Computer:~ matthew$
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #10
Blorx2 Wrote:I can't get any X11 apps to work (meaning I don't know how to use X11)...btw, does anyone have a link to SDL_image? Getting it from Fink didn't work too well during install while installing from source. It was missing all of the headers...
Have you tried here? Looks like you need to build it yourself these days....

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
5thPeriodProductions
Unregistered
 
Post: #11
Ha... Silly me. I'm going to be doing full-screen apps. I did want to make a couple of utility-style game-related apps that were window-based, but its not the end of the world if I make them OS X only. Heehee.

I played around with some SDL tutorials... Fun stuff! But, now I realize that I need to learn trig. : (
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #12
Nayr Wrote:I was under the impression windows gcc only supported C/C++ Huh

Travelling the interweb to http://gcc.gnu.org . . .

At the top:

"GCC, the GNU Compiler Collection, includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj,...)."

-Jon
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #13
Yes. But it comes with the objc library, not foundation. (which is probably what 5PP wants.)
[edit] More arguments. If they were to hypothetically use Foundation some way, they would have to package it in with the binaries, which is hard on linux.[edit2][/edit][/edit2]

It's not magic, it's Ruby.
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #14
Blorx2 Wrote:I can't get any X11 apps to work (meaning I don't know how to use X11)...btw, does anyone have a link to SDL_image? Getting it from Fink didn't work too well during install while installing from source. It was missing all of the headers...
How did you include them? "SDL_image.h", or <SDL_image/SDL_image.h>?
switch them, and see if that works.

It's not magic, it's Ruby.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #15
Like I said, you don't get any Cocoa with it, but Cocoa != ObjC, and it does you no good to confuse them.

GNUStep's Foundation may work on Windows, though how well GNUStep's foundation works in general is another question...

Putting a DLL next to an executable on Windows is trivial...
Quote this message in a reply
Post Reply