From: Ole Winther Message-Id: <199711012105.WAA27974@emma.ruc.dk> Subject: grx20 driving me mad! To: djgpp AT delorie DOT com Date: Sat, 1 Nov 1997 22:05:24 +0100 (MET) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Precedence: bulk Richard Sanders wrote #Hi Ole; #First, use 256 color mode, it is so much quicker than 16 #color mode. Star the 256 color mode like this: #GrSetMode(GR_width_height_color_graphics, 640, 480, 256); #Now your mouse, this is working for me: #/* seting the mouse up */ # GrMouseEvent rat; # GrMouseEventMode( 1 ); # GrMouseInit(); # GrMouseSetColors( WHITE, BLACK ); # atexit( GrMouseUnInit ); # # /* getting an event */ # #GrMouseDisplayCursor(); #do # GrMouseGetEventT( GR_M_EVENT, &rat, 0L ); #while( /* what ever your conditions are */ ); #GrMouseEraseCursor(); #Hope this helps a bit. #Cheers Richard The answer concerned this. > MOUSE problem. > I Use high Graphics svga mode (639x480 16 color) in the grx20 LIB. I have > used some cliping and graphics text function there does as expected. When > I include the mouse function as shown below, I got trouble. The below Code > is just one of many I had tryed and it didn't does as I supposed. > >The mouse cursor appear on the screen as it should, but when moving it >the old painting dosn't disappear when moving the mouse, and the >screen is painted in mouse color where I move it to. Have anyone a way >to solve that problem. >NB! the position and button, keyb function returns the true data > visual v; // ref til class contain some graphics rutine > char *taltx; // string for graphics output > taltx = new char[14]; > for( int O = 0; O < 13 ; O++ ) {taltx[O] = ' ';}; > strcpy( taltx, "\0" ); > GrMouseEvent evt; > int testmotion = 0; > int ii,mode, x = 0,y = 0, x3, y3; > if(GrMouseDetect()) > { > GrMouseEventMode(0); > GrMouseInit(); > ii = 0; > mode = GR_M_CUR_NORMAL; > GrMouseSetColors(GrWhite(),GrBlack()); > GrMouseDisplayCursor(); > GrMouseGetEventT(GR_M_NOPAINT,&evt,0L); > GrMousePendingEvent(); > x3 = evt.x; > y3 = evt.y; > do > { > GrMouseUpdateCursor(); > GrMouseGetEventT(GR_M_EVENT,&evt,0L); > key = evt.key; > if(evt.flags & (GR_M_KEYPRESS | GR_M_BUTTON_CHANGE | testmotion)) { > x3 = evt.x; > y3 = evt.y; > taltx[0] = v.nk[120]; // v.nk[N] array contain the keyb table > x = x3; > if( x >99) > { > x = (x - (x % 100)) /100; > taltx[3] = v.nk[x + 48]; > x = x % 100; > } else { taltx[3] = v.nk[48]; }; > if( x > 9 ) > { > x = (x - (x % 10)) /10; > taltx[4] = v.nk[x + 48]; > x = x % 10; > } else { taltx[4] = v.nk[48]; }; > taltx[5] = v.nk[x + 48]; > taltx[7] = v.nk[121]; > x = y3; > if( x >99) > { > x = (x - (x % 100)) /100; > taltx[9] = v.nk[x + 48]; > x = x % 100; > } else { taltx[9] = v.nk[48]; }; > if( x > 9 ) > { > x = (x - (x % 10)) /10; > taltx[10] = v.nk[x + 48]; > x = x % 10; > } else { taltx[10] = v.nk[48]; }; > taltx[11] = v.nk[x + 48]; > v._txsize( 12, 14 ); // graphics text size > v._txpos( 12, 12 ); // graphics text pos > GrFilledBox(11,11,300,35,GrWhite()); > v.outt( taltx ); // call graphics text output (converted default font) > testmotion = evt.buttons ? GR_M_MOTION : 0; > }; > if(evt.flags & GR_M_KEYPRESS) > { > if((key == 'Q') || (key == 'q')) break; > if((key != 'N') && (key != 'n')) continue; > }; > > } while ( evt.key !=13 ); > }; > v.VisualInputF(); // function create some cliping graphics > GrSetMode(GR_default_text); >_exit(0); > >As far I can figure out, the Frame driver (on My machine based on vga) don't >being associated with the GrMouse... functions, and thats the course? >I have tryed to build the mouse function in int 33 by My self, but it >seems to change the graphics in a way, so I can't use the graphics text >after displaying the mouse cursor. Yes it's true that the mouse are just doing fine with 256 colors but it isn't supported in the 640x480 solution. Infact I would like to use the high solution (640x480), and where looking for a way to do this. There is something more about the 640x480 solution problem, that it seems like the mouse change the graphics text, that means that the text draw being spoiled of the mouse, only background colors are printed!.