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_getattr</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
disp_getattr

Usage

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

Description

   Returns the current display attribute used by the display package.

Example 

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


   int main(int argc, char * argv[])
   {

       int att;
       if(argc!=2)
       {
           printf("Usage : PROG -R|Anotherflag\n
           printf("-R\t\Enters Reverse Video\n");
           printf("\tOther flags leave display alone\n");
           exit(EXIT_FAILURE);
       }
       disp_open();
       if( 'R' == toupper(argv[1][1]))
           disp_setattr(DISP_REVERSEVIDEO);
       if((att=disp_getattr())==DISP_REVERSEVIDEO)
           disp_printf("Attribute is reverse video.\n");
       else
           disp_printf
           ("No reverse video: attribute is: 0x%x\n",att);

       disp_flush();
       disp_close();
       return EXIT_SUCCESS;
   }

Return Value

   Returns the current display attribute. The following attributes are
   predefined in disp.h.

      DISP_REVERSEVIDEO,  DISP_NORMAL
      DISP_UNDERLINE,     DISP_NONDISPLAY

   Information can also be obtained regarding the color attributes on a
   color display. This is contained in the low byte. The high nibble of this
   byte contains the background color and the low nibble the foreground
   color. Thus a value of 0x17 indicates that the display will print 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

See Also

   Display package, disp_setattr



See Also: disp_setattr

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