home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
dos
/
tegl_ii
/
intro
/
prepare.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-06
|
1KB
|
44 lines
{-- This program shows how prepareforupdate and commitupdate work }
{-- together in uncovering and then recovering an image so that drawing }
{-- can be performed on a frame that is partially (or completely) }
{-- covered. }
Uses tgraph,TEGLIntr,TEGLUnit,TEGLMain;
VAR FS : ImageStkPtr;
BEGIN
EasyTEGL;
EasyOut;
{-- create the bottom frame (which we are going to draw on }
PushImage(1,1,100,100);
ShadowBox(1,1,100,100);
fs := StackPtr; {-- save the imagestkptr }
{-- create the frame that partially covers it. }
PushImage(50,50,150,150);
ShadowBox(50,50,150,150);
{-- as soon as there is a mouse press then we go to work }
WHILE Mouse_Buttons = 0 DO;
{-- tells the window manager to uncover the frame because we want to}
{-- work on it (draw to it). }
PrepareForUpdate(fs);
SetColor(blue);
Circle(fs^.x+48,fs^.y+45,40);
{-- commitupdate then tells the window manager that all drawing is done }
{-- and it can return things to how they were before prepareforupdate. }
CommitUpdate;
TEGLSupervisor;
END.