home *** CD-ROM | disk | FTP | other *** search
- {$A+,B-,D-,E-,F-,G-,I-,K-,L-,N-,O-,P-,Q-,R-,S-,T-,V-,W-,X-,Y-}
- {$M 16384,0,655360}
- (*=================================================================*)
- (* RDEMO.PAS *)
- (* Demo für Grafik im Protected Mode unter Verwendung von DLLS. *)
- (* Dieses Programm ist das Gegenstück zu PDemo und zeigt den *)
- (* freien Speicher im Real-Mode an *)
- (* Copyright (C) 1993 te-wi Verlag München *)
- (*=================================================================*)
-
- PROGRAM RDemo; (* Real-Mode Demonstration *)
-
- USES
- Crt, Dos, Graph;
-
- VAR
- gd, gm: INTEGER;
- s : STRING;
- ma : Real;
- i : INTEGER;
- BEGIN
- DetectGraph(gd, gm); (* Treiber ermitteln *)
- InitGraph(gd, gm, GetEnv('BGIPATH'));
- SetTextStyle(SmallFont, VertDir, 4); (* Copyright rechts hoch *)
- SetTextJustify(LeftText, BottomText);
- SetColor(Cyan); (* türkis *)
- OutTextXY(GetMaxX - 10, GetMaxY - 10, '(C) 1993 te-wi Verlag');
- SetColor(White); (* weiß *)
- Circle(GetMaxX DIV 2, GetMaxY DIV 2, GetMaxY DIV 2); (* Umkreis *)
- Circle(GetMaxX DIV 2, GetMaxY DIV 2, GetMaxY DIV 2 - 3);
- SetTextJustify(CenterText, CenterText); (* umdefinieren *)
- ma := MemAvail / 1024; (* Freien Speicher ermitteln *)
- Str(ma:3:0, s); (* ... und die Kbytes in einen String packen *)
- s := s + ' Kbytes RAM frei';
- s[Pos('.', s)] := ','; (* Punkt durch Komma ersetzen (nix USA! *)
- SetTextStyle(TriplexFont, HorizDir, 4); (* Messages ausgeben *)
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 4, 'Grafik im Real-Mode');
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 2, GetModeName(gm));
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 2 + GetMaxY DIV 4, s);
- SetWriteMode(AndPut); (* erst mal AndPut *)
- i := 1;
- REPEAT
- IF i <= 1 THEN
- BEGIN
- Randomize; (* Zufallszähler *)
- SetColor(Random(GetMaxColor + 1)); (* Farbe durch Zufall *)
- SetWriteMode(Random(4)); (* WriteModus durch Zufall *)
- END; (* Kreis mit Interferenzen: *)
- Circle(GetMaxX DIV 2, GetMaxY DIV 2, i);
- Inc(i, 2);
- IF i = (GetMaxY DIV 2) THEN i := 0;
- IF i = (GetMaxY DIV 2) - 1 THEN i := 1;
- IF i > (GetMaxY DIV 2) - 3 THEN
- BEGIN
- SetColor(Black); (* Die Schrift sollte immer *)
- SetWriteMode(NormalPut); (* wieder upgedated werden *)
- ma := MemAvail / 1024;
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 2 + GetMaxY DIV 4, s);
- Str(ma:3:0, s);
- s := s + ' Kbytes RAM frei';
- s[Pos('.', s)] := ',';
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 4,
- 'Grafik im Real-Mode');
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 2, GetModeName(gm));
- OutTextXY(GetMaxX DIV 2, GetMaxY DIV 2 + GetMaxY DIV 4, s);
- END;
- UNTIL KeyPressed; (* ... bis beliebige Taste *)
- CloseGraph; (* ... und Ende *)
- END.
-
- (*=================================================================*)