<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><head><title> Allegro Manual: MacOS X specifics </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" title="Default" type="text/css" href="allegro.css"></head><body bgcolor=white text=black link="#0000ee" alink="#ff0000" vlink="#551a8b"> <h1><a name="MacOS X specifics">MacOS X specifics</a></h1> <ul> <li><a href="#DIGI_*/MacOSX">DIGI_*/MacOSX</a> — Supported MacOSX digital sound drivers. <li><a href="#GFX_*/MacOSX">GFX_*/MacOSX</a> — Supported MacOSX graphic drivers. <li><a href="#MIDI_*/MacOSX">MIDI_*/MacOSX</a> — Supported MacOSX MIDI sound drivers. </ul> <p> In terms of file redistribution, the MacOS X platform behaves practically the same as the DOS platform. Read section chapter "Dos specifics" in the manual to learn more about this. <p> Allegro programs under MacOS X are Cocoa applications; in order to hide all the Cocoa interfacing to the end-user, you need to add the END_OF_MAIN() macro right after your main() function. This is a necessary step: if you omit it, your program will not compile. <p> The END_OF_MAIN() macro simply does some magic to make sure your program executes another function before your main(); this function is defined into the liballeg-main.a static library, which is automatically linked if you use the allegro-config script when linking. Otherwise be sure you link against it unless you want to get undefined symbol errors. <p> To behave nicely with the MacOS X user interface, Allegro apps will provide a standard application menu with the "Quit" menu item in it. The default behaviour when the user hits Command-Q or selects "Quit" is to do nothing. To override this behaviour you must call the set_close_button_callback() function; under MacOS X the supplied callback will be used either if the user clicks the window close button either on Command-Q or "Quit" selection. In this last case the application will not shutdown, but you are supposed to set some quit flag in your callback and check for it on a regular basis in your main program loop. <p> If you would like to use InterfaceBuilder to design a more fully-featured menu, Allegro will automatically load it if you create a bundle for your application. The use of InterfaceBuilder is beyond the scope of this document. Briefly, you need to create a Nib, called MainMenu.nib, containing a main menu and a controller. Then, when you create the bundle, install MainMenu.nib into the Contents/Resources subdirectory. Note that the actions attached to the menu items will be called from a different thread than the one in which your Allegro code is running. Therefore you should not do any work there (especially, don't call Allegro functions.) Instead, set a variable, and test it in your main loop. <p><br> <div class="al-api"><b>Drivers <a name="GFX_*/MacOSX">GFX_*/MacOSX</a></b></div><br> MacOS X Allegro supports the following card parameters for the set_gfx_mode() function: <ul><li> GFX_TEXT<br> This closes any graphics mode previously opened with set_gfx_mode. <li> GFX_AUTODETECT<br> Let Allegro pick an appropriate graphics driver. <li> GFX_AUTODETECT_FULLSCREEN<br> Autodetects a graphics driver, but will only use fullscreen drivers, failing if these are not available on current platform. <li> GFX_AUTODETECT_WINDOWED<br> Same as above, but uses only windowed drivers. <li> GFX_SAFE<br> Special driver for when you want to reliably set a graphics mode and don't really care what resolution. See the set_gfx_mode() documentation for details. <li> GFX_QUARTZ_FULLSCREEN<br> Fullscreen exclusive mode, using the CGDirectDisplay interface. Supports only resolutions higher or equal to 640x480, and uses hardware acceleration if available. <li> GFX_QUARTZ_WINDOW<br> Windowed mode using QuickDraw in a Cocoa window. </ul> <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg008.html#set_gfx_mode" title="Sets a graphic video mode.">set_gfx_mode</a>.</blockquote> <div class="al-api"><b>Drivers <a name="DIGI_*/MacOSX">DIGI_*/MacOSX</a></b></div><br> The MacOS X sound functions support the following digital sound cards: <blockquote class="text"><pre> DIGI_AUTODETECT - let Allegro pick a digital sound driver DIGI_NONE - no digital sound DIGI_CORE_AUDIO - CoreAudio digital output (OS >= X.2 required) DIGI_SOUND_MANAGER - Carbon Sound Manager digital output </pre></blockquote> <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg024.html#detect_digi_driver" title="Detects whether the specified digital sound device is available.">detect_digi_driver</a>, <a class="xref" href="alleg024.html#install_sound" title="Initialises the sound module.">install_sound</a>, <a class="xref" href="alleg029.html#install_sound_input" title="Initialises the sound recorder module.">install_sound_input</a>.</blockquote> <div class="al-api"><b>Drivers <a name="MIDI_*/MacOSX">MIDI_*/MacOSX</a></b></div><br> The MacOS X sound functions support the following MIDI sound cards: <blockquote class="text"><pre> MIDI_AUTODETECT - let Allegro pick a MIDI sound driver MIDI_NONE - no MIDI sound MIDI_CORE_AUDIO - CoreAudio MIDI synthesizer (OS >= X.2 required) MIDI_QUICKTIME - QuickTime Music Note Allocator MIDI output MIDI_DIGMID - sample-based software wavetable player </pre></blockquote> <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg024.html#detect_midi_driver" title="Detects whether the specified MIDI sound device is available.">detect_midi_driver</a>, <a class="xref" href="alleg024.html#install_sound" title="Initialises the sound module.">install_sound</a>, <a class="xref" href="alleg029.html#install_sound_input" title="Initialises the sound recorder module.">install_sound_input</a>.</blockquote> <hr><div class="al-back-to-contents"><a href="allegro.html">Back to contents</a></div> </body> </html>