[comp.sys.atari.st] To Gem or not to Gem

m204help@cca.CCA.COM (Keith Hedger) (09/23/87)

I am designing some MIDI software for the ST and I have some questions.
I have a 520 ST, Megamax C and am fairly new to both. In working with
some commercially available programs, I have seen features that I like.
I'm not talking about specific features, but some programs do things that
are pretty general processes that I would like to be able to do. I have taken
for granted that these things are being done using Gem, but now I'm not so
sure. 
If I want to clear the desktop, reset the screen colors, display text ont
the screen, maybe do some primitive graphics type processing, do I have to
use GEM ? If I run a program that does these things, is there a way (without
the source) to tell if the program is using GEM.? I don't want to steal any
code or anything, I'm just trying to figure out if it is a REQUIRMENT to use
GEM for certain types of processing, or if I have the option of not using it,
and if so, what are the benefits and detrements ?
If the above example ( or any part of it ) can be done in 'C', can any one
point me to the proper functions to do these things, or to build functions
that will do these things.
Thank you,
Keith Hedger
Confused in Cambridge

holloway@drivax.UUCP (09/25/87)

In article <20123@cca.CCA.COM> m204help@cca.CCA.COM (Keith Hedger) writes:

>If I want to clear the desktop, reset the screen colors, display text on
>the screen, maybe do some primitive graphics type processing, do I have to
>use GEM ? If I run a program that does these things, is there a way (without
>the source) to tell if the program is using GEM.? I don't want to steal any
>code or anything, I'm just trying to figure out if it is a REQUIRMENT to use
>GEM for certain types of processing, or if I have the option of not using it,
>and if so, what are the benefits and detrements ?

You can talk to the hardware yourself; the screen is an interleaved bitmap
(for each 16 pixels on the screen, there are one to four 16-bit words in
memory holding the color indexes), and the palette is easy to write to (using
the XBIOS calls, or directly). So you don't NEED GEM, really.

But if your program is written correctly, GEM will let your program run in
any of the three video modes, WITHOUT MODIFICATION. Further, if you stick to
GEM entirely, you'll be able to move directly over to the IBM PC version of
GEM with only a recompile (although things are rarely that nice, but it is
fairly easy to move things from one system to the other).

GEM also lets you use windows, alerts, dialogs, menus, control the mouse
movement and form, and do primitive animation (the best animation is done by
bypassing GEM, but it's harder to do, and far less portable). GEM handles
drawing lines of variable widths, circles, boxes, rectangles, polygons,
etc. etc.... Text of varying sizes and faces (especially if you have GDOS),
and all that.

GEM is NOT well suited for other things, such as image processing and 3D
graphics. Also, in its current stunted form (as implemented on the Atari ST),
it can't save the graphics commands to a file, and is limited to a narrow
range of fonts.

All in all, I think you'd be best off using it. Most 'C' compilers come with
GEM bindings in their libraries, such as Megamax 'C', Mark William's 'C',
and Atari's Developer's Kit (with Alcyon 'C' - the one I use). MWC has a
very good manual, but you'll probably want to pick up a copy of Baum and
Fitler's guide to GEM programming (Sybex) if you're new to GEM.

- Bruce
-- 
*******************************************************************************
* Bruce Holloway - Terminal Netnews Addict       uunet!amdahl!drivax!holloway *
* ALBATROSS, ATARI*TROS @ Plink                            ALBATROSS @ Delphi *
*******************************************************************************