Strange problem

Search this archive.

From: Jay Link (jlink@ilbbs.com)
Date: Sun 16 Dec 2001 - 20:35:58 IST


Hi all --

I'm trying to implement a simple flashing cursor, and I'm using screen
mode G640x480x256. My problem is that if the cursor is printed with a Y
(vertical) value of around 400 (say, 390 - 410), it gets intermittantly
printed about 100 pixels to the upper left of where it should be.

I've used both gl_write() and gl_fillbox() to print the cursor, and both
have the same result.

I've used both SVGAlib versions 1.4.x and 1.9.x and the problem is
consistent.

Any ideas? Has anyone experienced this sort of thing before?

---

While I'm at it, maybe there's a better way to program a flashing cursor?
Here's what I'm doing:

1) Early in the program, I set a timer that runs constantly throughout the
program, even when I'm not using the cursor:

   signal(SIGVTALRM, catch_alarm);
   interval.it_interval.tv_sec = 0;
   interval.it_interval.tv_usec = 200000;
   interval.it_value.tv_sec = 0;
   interval.it_value.tv_usec = 200000;
   setitimer(ITIMER_VIRTUAL, &interval, NULL);

According to Rus, leaving this running doesn't add much (any?) overhead.

2) Then, I have a global variable called "cursor" which can be either 0 or
1. Every time the timer goes off (5 times a second), I swap the value of
cursor like so:

   void catch_alarm(int vtalrm)
   {
      cursor = (cursor == 1) ? 0 : 1;
      signal(SIGVTALRM, catch_alarm);
   }

3) If I need the flashing cursor then, I print it or erase it, depending
on the value of "cursor".

Is there a better way? My flashing cursor is fairly consistent, but
sometimes it gets a little jittery when other processes are running. How
does something like the bash shell cursor remain so fluid & constant?


Thanks,

-J


------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST