Home
Amiga
AmigaDE
AmigaOne
Pegasos

The Crystal Library


Crystal library

Written by Arend-Paul Spijkerman

(c) copyright 1992-2001


(Find the 2nd beta HERE)



The crystal library is a system made to be able
to compile programs for a number of targets.

It makes it possible to write a program on a classic
amiga and compile it also for AmigaDE and Amiga OS4.2

Which makes it very easy to write software for the AmigaDE,
because it uses the classic style and can be ran
on classic amigas before compiling on AmigaDE is attempted.
Or the AmigaDE will be made to look like a classic system.
Also P96 and AHI is supported for compiling under AOS 4.2


This library was made in the first place by the
programmer to make his work easier to develop
games and other aplications for new generation
amigas and perhaps other systems like macs.





It has 3 major goals:

-It has a library that makes it possible to compile
sources for the classic amiga on AmigaDE.

-It has an abstraction layer that makes it possible
to use old style classic amiga graphics calls that get
translated to other graphics systems.
It also embeds support for P96 and cybergraphics.

-It adds a lot of functionality like 24 bit graphics
with 2D and 3D and a dynamic GUI library.
A 3D game engine.
This is a major advantage, because you use one type
of GUI call .. and it still compiles on different
platforms.



From here on a program that is ported to the Cryrstal
library will be called crystalized. Which means the
under laying system if transparent for the program.
It only sees the abstraction layer of crystal.


This system has a long history, some of the graphics
algoritmes started as basic or assembly in demos
and programs on the Commodore 64.
Most of it evolved in libraries i wrote for programs
in the years 1992-2002 like the Trion BBS system,
merlin , choplift 3d etc.

Because the AmigaDE is fundamental so much different
then the classic amiga, an abstraction layer system
was added to the libraries .. and the Crystal
library was born.




The library conssists of the following components:






APS library .. which are definitions, stubs and functions
that make it possible to compile a source of the classic amiga
on amigaDE.






Crystal core .. This is an abstraction layer to the operating
system (graphics) , it hides calls to the OS and makes it look
a lot like a classic amiga with a lot of added functionality.

For instance, you need to use:

win->plot(win, x, y, c);

instead of:

plot(win, x, y, c);

A lot of new calls are added, it has been made possible
to load a picture, and show it on whatever screen is
available (HAM6, HAM8, 1-8 planes, Workbench)
with only 4 calls.


Crystal is very object oriented, every graphics target has
a module (AGA, P96, Cybergraphics, AmigaDE) which routes
calls to the underlaying OS if possible
or uses the internal graphics libraries.
Internal it uses 24 bit graphics buffers with Z-buffering,
which can be put rendered on any window, even with dithering,
colormapping or HAM.
Also because it is very object oriented it should
be possible to only use the parts you need.





aplication class .. used to hide initializations
and other system depended things.





24 bit graphics with Z-buffering.

2D graphics library, a FAST library with functions to draw
dotted curves with different line styles.
Draw circles do flood fills and blit other graphics etc.

3D graphics library, a FAST library to draw shaded
and textured graphics.

3D game library/engine, which is able to rotate and
draw 3D objects which are shaded and textured.





The merlin GUI library and engine.
This library completely handles a GUI,
all you need to do is make a simple call
for each object you want to add.
All objects are places in horizontal and vertical
groups, so the library can place them by itself.
Or if the window is resized , new sizes are
calculated and objects get new positions.
Dynamic objects like lists can get longer and shorter.

A lot of object types are supported, from groups,
texts, pictures, buttons, lists, ANSI and ripscrip
screens, buildin patterns.

Also it is possible to define a GUI in a little
text file, as a resource. So the GUI of a program
can be changed by placing patterns of pictures
under objects.



The excaliber graphics engine which uses the 2D/3D
graphics library add the ability to define a
graphics page in a small script with all the
graphics commands. It even can save it as a
graphics file or show it in a window.
It also can be used to draw backgrounds for
merlin objects.





Files .. library to load and save IFF and FCT graphics files,
FCT is the internal format, which is faster then IFF and has
better compression.


Even more is emplemented or being implemented
Like:
arexx like functionality
the sound handler
the extended file typer that uses a library file

Also when the little merlin tools are ported
it should be useable to browse your HD with merlin.


Download the the last beta of crystal.
Includes executable for classic amiga and AmigaDE V1.00.
crystb46.lha 200kB DOWNLOAD

The Crystal Library

Picture with both targets side by side.


GUI script interpreted on AmigaDE.

GUI script interpreted on classic Amiga.

GUI script interpreted on a Picasso 96 card.

GUI script interpreted on Cybergraphics.


Some graphics lib. calls on AmigaDE.

Some graphics lib calls on classic Amiga.


The excaliber mode shows and saves rendered scripts.

Feedback


Copyright 2001 by Arend-Paul Spijkerman

cnt