home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1997 #3
/
amigamamagazinepolishissue03-1
/
ma_1995
/
09
/
ami931b.txt
< prev
next >
Wrap
Text File
|
1997-04-07
|
2KB
|
134 lines
^-
<l>
/* Listing #8 */
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <proto/intuition.h>
struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;
struct Screen *wbscreen, *ekran=0;
struct DrawInfo *wbdinfo=0;
ULONG wbmodeid;
void wyjscie(int kodpowr)
{
if (ekran)
CloseScreen(ekran);
if (wbdinfo)
FreeScreenDrawInfo(wbscreen, wbdinfo);
if (wbscreen)
UnlockPubScreen(0, wbscreen);
CloseLibrary((struct Library*)GfxBase);
CloseLibrary((struct Library*)IntuitionBase);
exit(kodpowr);
}
int main(int argc, char *argv[])
{
check_os(OS_20);
if (!(IntuitionBase=(struct IntuitionBase*)OpenLibrary("intuition.library", 37)))
return 20;
if (!(GfxBase=(struct GfxBase*)OpenLibrary("graphics.library", 37)))
{
CloseLibrary((struct Library*)IntuitionBase);
return 20;
}
if (((struct Library*)IntuitionBase)->lib_Version<39)
{
if (!(wbscreen=LockPubScreen(0)))
wyjscie(10);
if (!(wbdinfo=GetScreenDrawInfo(wbscreen)))
wyjscie(10);
if ((wbmodeid=GetVPModeID(&wbscreen->ViewPort))==INVALID_ID)
wyjscie(10);
ekran=OpenScreenTags(0,
SA_Width, wbscreen->Width,
SA_Height, wbscreen->Height,
SA_Depth, wbdinfo->dri_Depth,
SA_Title, "Klon Workbencha",
SA_SysFont, 1,
SA_Type, CUSTOMSCREEN,
SA_DisplayID, wbmodeid,
SA_AutoScroll, (wbscreen->Flags & AUTOSCROLL),
SA_Pens, wbdinfo->dri_Pens,
TAG_DONE);
}
else
ekran=OpenScreenTags(0,
SA_Title, "Klon Workbencha",
SA_LikeWorkbench, TRUE,
TAG_DONE);
if (!ekran)
wyjscie(10);
Delay(500);
wyjscie(0);
}