CompuServe Messages

#Screen Clearing

    25-Jan-88 21:29:52
Sb: #105328-#Screen Clearing
Fm: Bob Shimbo 70260,231
To: Bob Shimbo 70260,231
Ok, once more with feeling. /* Aztec C V3.40a, cc test, ln -W +cd test.o -lc */ /* includes */ #include <exec/types.h> #include <exec/nodes.h> #include <exec/lists.h> #include <exec/memory.h> #include <exec/errors.h> #include <exec/ports.h> #include <exec/libraries.h> #include <exec/io.h> #include <exec/devices.h> #include <devices/inputevent.h> #define Msg IOStdReq #include <libraries/dos.h> #include <libraries/dosextens.h> #include <graphics/gfx.h> #include <graphics/regions.h> #include <hardware/blit.h> #include <hardware/custom.h> #define blitNode bltnode #include <graphics/copper.h> #include <graphics/display.h> #include <graphics/gels.h> #include <graphics/clip.h> #include <graphics/rastport.h> #include <graphics/view.h> #include <graphics/gfxbase.h> #include <graphics/text.h> #include <graphics/gfxmacros.h> #include <graphics/layers.h> #include <intuition/intuition.h> #include <intuition/intuitionbase.h> #includ <stdio.h> #include <math.h> #include <ctype.h> #include <fcntl.h> #include <functions.h> #define SBMWIDTH 320L #define SBMHEIGHT 200L #define SBMDEPTH 5L #define INTUITION_REV 29L #define GRAPHICS_REV 29L int debug = 1; struct DosLibrary *DosBase; struct IntuitionBase *IntuitionBase; struct GfxBase *GfxBase; struct Screen *Screen; struct TextAttr MyFont = { (UBYTE *)"topaz.font", TOPAZ_EIGHTY, FS_NORMAL, FPF_ROMFONT }; struct NewScreen NewScreen = { 0L, 0L, SBMWIDTH, SBMHEIGHT, SBMDEPTH, 26L, 1L, NULL, CUSTOMSCREEN | SCREENBEHIND, &MyFont, NULL, NULL, NULL }; int Stars[512]; main() { DosBase = (struct DosLibrary *)OpenLibrary("dos.library", 0L); IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", INTUITION_REV); GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", GRAPHICS_REV); Screen = OpenScreen(&NewScreen); Stars[510] = 10; Move(&Screen->RastPort, 0l, 0l); printf("mag=%d\n", Stars[510]); /* prints 10 */ ClearScreen(&Screen->RastPort); printf("mag=%d\n", Stars[510]); /* prints 0 */ CloseScreen(Screen); CloseLibrary((struct Library *)GfxBase); CloseLibrary((struct Library *)IntuitionBase); CloseLibrary((struct Library *)DosBase); }