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++ Language Reference - disp_setattr 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:

   black
   blue
   green
   cyan
   red
   magenta
   brown
   white

   The following attribute bits can be OR'ed in:
   DISP_INTENSITY, DISP_BLINK

   Example
   #include <disp.h>

   main()
   {
        disp_open();
        disp_move(0,0);
        disp_eeop();
        disp_printf("This is normal video\n");
        disp_settatt(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();
   }


See Also: Display_package disp_setmode disp_getmode

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