home *** CD-ROM | disk | FTP | other *** search
- #include "srgp.h"
-
- #define chipwidth 20
- #define chipheight 20
- #define vertmarg 5
- #define horizmarg 40
-
-
- int w, heightofcanvas0;
- int i, x, y;
- int whichdev;
- char str[10];
-
- attribute_group bund;
-
- unsigned short redi, greeni, bluei;
-
-
- static void ShowPat (int num, char *numstr)
- {
- SRGP_setFillBitmapPattern (num);
- SRGP_fillRectangleCoord (x, y, x + chipwidth, y + chipheight);
- SRGP_text (SRGP_defPoint(x + chipwidth+4, y+8), numstr);
- y = y + chipheight+vertmarg;
- }
-
- main()
- {
- SRGP_begin ("SRGP Patterns", SCREEN_WIDTH, SCREEN_HEIGHT, 2, FALSE);
- SRGP_inquireCanvasSize (0, &w, &heightofcanvas0);
- SRGP_text (SRGP_defPoint(5, heightofcanvas0-15),
- "Drawn in REPLACE mode. Color use shown at right. Hit key to exit.");
-
- x = 5;
- y = 5;
-
- SRGP_setFillStyle (BITMAP_PATTERN_OPAQUE);
-
- for (i=0; i<=104; i++) {
- sprintf (str, "%2d", i);
- ShowPat(i, str);
- if (y > (heightofcanvas0-40)) {
- y = 5;
- x = x + chipwidth + horizmarg;
- }
- }
-
- SRGP_loadCommonColor (2, "red");
- SRGP_loadCommonColor (3, "green");
-
- SRGP_setColor (2);
- SRGP_setBackgroundColor (3);
-
- y = 5;
- x = x + chipwidth + horizmarg;
-
- for (i=0; i<=35; i++) {
- sprintf (str, "%2d", i);
- ShowPat(i, str);
- if (y > (heightofcanvas0-40)) {
- y = 5;
- x = x + chipwidth + horizmarg;
- }
- }
-
- SRGP_setInputMode (LOCATOR, EVENT);
- SRGP_setKeyboardProcessingMode (RAW);
- SRGP_setInputMode (KEYBOARD, EVENT);
- SRGP_waitEvent (INDEFINITE);
- SRGP_end();
- }
-