home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga ACS 1998 #6
/
amigaacscoverdisc1998-061998.iso
/
games
/
shareware
/
gms
/
doublebuffer.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-06-08
|
1KB
|
46 lines
/*
** Name: Double Buffer Demo
** Author: Paul Manias
** Copyright: DreamWorld Productions © 1996-1997.
** SAS/C: 1> sc DoubleBuffer.c link startup=LIB:gms.o data=far
** Dice: 1> dcc -l0 -mD gms.o DoubleBuffer.c -o DoubleBuffer
**
** This simple demo shows how to double buffer the screen.
**
*/
#include <proto/games.h>
extern struct GMSBase *GMSBase;
ULONG PREFSNAME = DEFAULT;
void main(void)
{
struct Picture *picture;
struct GameScreen *screen;
if (picture = LoadPicFile("GMS:demos/data/PIC.Green",GETPALETTE|VIDEOMEM)) {
if (screen = AddScreenTags(TAGS_GAMESCREEN,NULL,
GSA_MemPtr1, picture->Data,
GSA_Planes, picture->Planes,
GSA_ScrMode, picture->ScrMode,
GSA_ScrType, picture->ScrType,
GSA_ScrWidth, picture->Width,
GSA_ScrHeight,picture->Height,
GSA_Palette, picture->Palette,
GSA_Attrib, DBLBUFFER|CENTRE,
TAGEND)) {
ShowScreen(screen);
while (!(ReadMouse(JPORT1)&MB_LMB)) {
WaitVBL();
SwapBuffers(screen);
}
FreePic(picture);
}
DeleteScreen(screen);
}
}