Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>disp_setattr</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
disp_setattr

Usage


   #include <disp.h>
   void disp_setattr(int attr);

Description

   Sets the display attribute for characters written by disp_putc and
   disp_printf. Below is a list of the predefined attributes to be found in
   the disp.h file.

      DISP_REVERSEVIDEO,  DISP_NORMAL,
      DISP_UNDERLINE,     DISP_NONDISPLAY

   It is possible to use this function to set the color attributes for use
   with a color display. The easiest way to do so is by their entry as a one
   byte hexadecimal number, where the high nibble holds the background color
   and the low nibble the foreground color. Thus the call disp_setattr(0x17)
   will set up white text on a blue background. Possible color settings for
   an IBM compatible color adaptor are:

               0       black

               1       blue
               2       green
               3       cyan
               4       red
               5       magenta
               6       brown
               7       white

   The following attribute bits can be ORed in:

       DISP_INTENSITY, DISP_BLINK

Example 

   #include <disp.h>
   #include <stdlib.h>

   int main()
   {
       disp_open();

       disp_move(0,0);
       disp_eeop();
       disp_printf("This is normal video\n");
       disp_setattr(DISP_NORMAL|DISP_INTENSITY);
       disp_printf("This is bright\n");
       disp_setattr(DISP_REVERSEVIDEO);
       disp_printf("and this is inverse video\n");
       if (disp_getmode() == 3) {
           disp_setattr(0x17);
           disp_printf("This is white on blue...\n");
       }
       disp_close();
       return EXIT_SUCCESS;
   }

See Also

   Display package, disp_setmode, disp_getmode




See Also: disp_setmode disp_getmode

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson