home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d190
/
ilbm2image.lha
/
ILBM2Image
/
parrotstest.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-03-11
|
2KB
|
128 lines
/* test program for ILBM2func by Denis Green*/
#include <exec/types.h>
#include <intuition/intuition.h>
#include "libraries/diskfont.h"
#include "graphics/gfxmacros.h"
extern long IntuitionBase;
extern long GfxBase;
struct ViewPort *vp;
struct ColorMap *cm;
#define INTUITION_REV 33
#define GRAPHICS_REV 33
struct TextAttr MyFont =
{
"topaz.font",
9,
0,
FPF_ROMFONT,
};
struct NewScreen NewScreen =
{
0,
0,
320,
200,
5, /* depth = 6 for HAM */
0,1,
NULL, /* ViewModes */
CUSTOMSCREEN,
&MyFont,
"Test Screen",
NULL,
NULL,
};
struct NewWindow NewWindow =
{
0,
0,
320,
200,
0,
1,
CLOSEWINDOW,
WINDOWCLOSE | SMART_REFRESH | ACTIVATE | WINDOWDRAG | WINDOWDEPTH | WINDOWSIZING | NOCAREREFRESH,
NULL,
NULL,
"A test",
NULL, /* pointer to screen set later or errors result */
NULL,
60,
80,
640,
200,
CUSTOMSCREEN,
};
/* Image parrots
Width: 320
Height: 256
Depth: 5 */
USHORT map[] = {
0x0000,
0x0eca,
0x0d00,
0x0a00,
0x0fa6,
0x0fe0,
0x08f0,
0x0080,
0x00b6,
0x00dd,
0x00af,
0x007c,
0x000f,
0x070f,
0x0c0e,
0x0c08,
0x0620,
0x0e52,
0x0960,
0x0fca,
0x0333,
0x0444,
0x0555,
0x0666,
0x0777,
0x0888,
0x0999,
0x0aaa,
0x0ccc,
0x0ddd,
0x0eee,
0x0fff
};
struct Window *Window;
void main()
{
struct Screen *Screen;
IntuitionBase =
OpenLibrary("intuition.library",INTUITION_REV);
if (IntuitionBase == NULL) exit(FALSE);
GfxBase = OpenLibrary("graphics.library",GRAPHICS_REV);
if (GfxBase == NULL) exit(FALSE);
if ((Screen = (struct Screen *)OpenScreen(&NewScreen)) == NULL)
exit(FALSE);
NewWindow.Screen = Screen; /* setting pointers now */
if((Window = (struct Window *)OpenWindow(&NewWindow)) == NULL) exit(FALSE);
vp = (struct ViewPort *)ViewPortAddress(Window);
cm =(struct ColorMap *)GetColorMap(32);
LoadRGB4(vp,map,32);
parrotsimagefunc();
Wait(1 << Window->UserPort->mp_SigBit);
CloseWindow(Window);
CloseScreen(Screen);
FreeColorMap(cm);
CloseLibrary(GfxBase);
CloseLibrary(IntuitionBase);
exit(TRUE);
}