home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / FSGFX.ZIP / G_RDRWTH.C < prev    next >
C/C++ Source or Header  |  1990-03-06  |  688b  |  31 lines

  1. /* g_rdrwth.c */
  2. /* thread for resetting graphics state across session switches */
  3.  
  4. #include "mygraph.h"
  5. #include "mymouse.h"
  6.  
  7. void far g_rdrwth()
  8. {
  9.         char *oldscreen;
  10.     unsigned int fnotify;
  11.     oldscreen = pchscreen;
  12.     while(1)
  13.     {
  14.         g_doscall(VioSavRedrawWait(0,&fnotify,0));
  15.         if(fnotify)
  16.         {
  17.             g_doscall(VioSetMode(&newconfig,0));    /* set graphics mode */
  18.             pchscreen = oldscreen; /* causes program to write to screen */
  19.             g_restore(screenbuffer,28000);
  20.             DosResumeThread(mousethreadid);
  21.         }
  22.         else
  23.         {
  24.             DosSuspendThread(mousethreadid);
  25.             g_save(screenbuffer,28000); 
  26.             pchscreen = screenbuffer; /* causes program to write to buffer */
  27.         }
  28.     }
  29. }
  30.  
  31.