home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Double Buffer Demo
- ** ------------------
- ** This just shows how to double buffer the screen.
- **
- */
-
- #include <proto/games.h>
- #include <proto/exec.h>
-
- #define AMT_PLANES 5
-
- struct GMSBase *GMSBase;
- extern struct ExecBase *SysBase;
-
- struct Picture pic = {
- PCV1, /* Version header */
- 0, /* Destination */
- 320,0,256, /* Width, Height */
- AMT_PLANES, /* Amount of Planes */
- 32, /* Amount of colours */
- 0, /* Palette */
- LORES|COL12BIT, /* Screen mode */
- INTERLEAVED, /* Destination */
- GETPALETTE, /* Parameters */
- "GAMESLIB:data/IFF.Pic320"
- };
-
- struct Picture *picture = &pic;
- struct GameScreen *GameScreen;
-
- /*=========================================================================*/
-
- void main(void)
- {
- if (GMSBase = (struct GMSBase *) OpenLibrary("games.library", 0)) {
- SetUserPrefs(0);
-
- if (GameScreen = AddScreenTags(TAGS,NULL,
- GSA_Planes,AMT_PLANES,
- GSA_ScrMode,LORES|COL12BIT,
- GSA_ScrType,INTERLEAVED,
- GSA_ScrWidth,320,
- GSA_ScrHeight,256,
- GSA_Attrib,DBLBUFFER,
- TAGEND)) {
-
- picture->Data = GameScreen->MemPtr1;
- if (LoadPic(picture) == ERR_OK) {
- GameScreen->Palette = picture->Palette;
- UpdatePalette(GameScreen);
- ShowScreen(GameScreen);
- while (!(ReadMouse(JPORT1)&MB_LMB)) {
- WaitSVBL();
- SwapBuffers(GameScreen);
- }
- FreePic(picture);
- }
- DeleteScreen(GameScreen);
- }
- CloseLibrary((struct Library *)GMSBase);
- }
- }
-
- /*=========================================================================*/
-
-