Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <exec/types.h>
- #include <intuition/intuition.h>
- #include <intuition/intuitionbase.h>
- #include <clib/intuition_protos.h>
- #include <clib/exec_protos.h>
- #include <clib/graphics_protos.h>
- struct GfxBase *GfxBase;
- struct Library *IntuitionBase;
- struct RastPort *rp;
- struct TextAttr TextFont = {
- "topaz.font",
- 8,0,0
- };
- struct Window *CurrentWindow;
- struct Screen *CurrentScreen;
- struct IntuiMessage *message;
- struct NewScreen InitScreen = {
- 0,0,
- 640,200,
- 3,
- 0,1,
- HIRES,
- CUSTOMSCREEN,
- &TextFont,"Our Custom Screen",NULL
- };
- struct NewWindow InitWindow = {
- 0,11,
- 640,189,
- 0,1,
- MOUSEBUTTONS | CLOSEWINDOW,
- ACTIVATE | WINDOWCLOSE,
- NULL,
- NULL,
- "Four in a row",
- NULL,
- NULL,
- 0,0,640,189,
- CUSTOMSCREEN
- };
- void setupdisplay()
- {
- GfxBase=(struct GfxBase *)OpenLibrary("graphics.library",0);
- if (GfxBase==NULL) exit (100);
- IntuitionBase=(struct Library *) OpenLibrary ("intuition.library",0);
- if (IntuitionBase==NULL) {
- CloseLibrary((struct Library *)GfxBase);
- exit(200);
- }
- CurrentScreen=(struct Screen*) OpenScreen(&InitScreen);
- if (CurrentScreen==NULL) {
- CloseLibrary(IntuitionBase);
- CloseLibrary((struct Library *)GfxBase);
- exit (300);
- }
- InitWindow.Screen=CurrentScreen;
- CurrentWindow=(struct Window *) OpenWindow (&InitWindow);
- if (CurrentWindow==NULL) {
- CloseScreen(CurrentScreen);
- CloseLibrary(IntuitionBase);
- CloseLibrary((struct Library *)GfxBase);
- exit (400);
- }
- rp=CurrentWindow->RPort;
- }
- void closedown()
- {
- CloseWindow(CurrentWindow);
- CloseScreen(CurrentScreen);
- CloseLibrary(IntuitionBase);
- CloseLibrary((struct Library *)GfxBase);
- }
- void main()
- {
- unsigned long int class;
- setupdisplay();
- do {
- while ((message=(struct IntuiMessage *)GetMsg (CurrentWindow->UserPort))==NULL);
- class=message->Class;
- ReplyMsg(message);
- } while (class!=CLOSEWINDOW);
- closedown();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement