TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Bryan Callahan
from: Peter Fitzsimmons
date: 1996-03-27 03:15:04
subject: Colors under OS/2 Watcom

BC>     I just switched to using Watcom, and started 
 BC> compiling OS/2 full-screen programs. Everything works 
 BC> great with minimum code adjustment expect for colors. 
 BC> I can't seem to figure out how to use color under a 
 BC> OS/2 full-screen session.

See Vio...() in PRCP.INF (available from many bbs's, or the devcon cdroms).

Here is a small sample:


 // compiled with ibm cset++ v2:
 // icc /Kb+ /O /Oi /Rn /Sse /G4  vio.c

 #define INCL_NOPMAPI
 #define INCL_VIO
 #include 
 #include 
 #include 

 int main(void)
 {
     int i;
     char msg[40];
     BYTE attr;

     VioScrollUp(0, 0, 0xffff, 0xffff, 0xffff, " \x7", 0);  // cls
     VioSetCurPos(23, 0, 0);      // so cursor is at bottom when program ends

     attr = 15;  // start off with bold on black background.
     for(i=0; i<22; i++){
         sprintf(msg, "Line %2d: Programming is fun!", i);
         VioWrtCharStrAtt(msg, strlen(msg), i, i, &attr, 0);

         attr += 16;     // change background colour.  Note: attributes
                         // are just like they are under dos when poking
                         // into video memory.
     }
     return 0;
 }


--- Maximus/2 3.00
* Origin: Sol 3 * Toronto * V.32 * (905)858-8488 (1:259/414)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 259/414 400 99 250/99 3615/50 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.