www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/23/03:19:17

From: Meta <syzmik AT concentric DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: GRX 2.0 and Mouse Flicker
Date: Tue, 19 Aug 1997 22:25:53 -0400
Organization: Concentric Internet Services
Lines: 40
Message-ID: <33FA55B1.404B@concentric.net>
Reply-To: syzmik AT concentric DOT net DOT NOSPAM
NNTP-Posting-Host: ts012d12.sag-mi.concentric.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

After hacking up some code for using the mouse, in polled mode, I was
horrified by the amount of flicker. Can someone post interrupt driven or
some flicker free mouse code for GRX v2? Here's what I got:

// MouseGRX.c
#include <stdio.h>
#include <grx20.h>

void main (void)
{
 GrMouseEvent MS;              // mouse structure

 if (!(GrMouseDetect()))
 {
  puts("\n\nNo mouse found on this system\n\n");
  return;
 }

 if (!(GrSetMode(GR_width_height_graphics, 640, 480)))
 {
  puts("\n\nNo Graphics Hardware Support\n\n");
  return;
 }

 GrMouseEventMode(0);          // init mouse to polled mode
 GrMouseInit();                // turn on the mouse

 GrMouseDisplayCursor();       // make the cursor visible

 while (!(MS.buttons & GR_M_RIGHT))
 {
  GrMouseGetEvent(GR_M_POLL, &MS);
  if (MS.buttons & GR_M_LEFT)
   GrPlot(MS.x, MS.y, 15);
 }

 GrMouseEraseCursor();         // erase mouse
 GrMouseUnInit();              // no more mouse
 GrSetMode(GR_80_25_text);     // no more graphics
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019