[XFree86] XDrawLine problem with XFree86.4.2.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I apologize for not reporting this using Bugzilla.  I wasn't having much luck getting returns on my queries.

I recently installed Mandrake 8.2 on a system and attemped to use an application that I wrote which acquires and displays waveforms.  It was immediately obvious that there was a problem with the XDrawLine call used in the plotting function.

The installation used the XFree86.4.2.0 release.  The videao card is an S3 Trio64 (generic 86C764/765).  Installing the XFree86.3.3.6 release cured the problem.  The basic problem is the second point on the line is not in the correct position.

I am attaching a small program (psrc.c) which exibits the problem.  The program uses the xforms library for the API.  The call to draw the lines, "fl_line", is simply a call to XDrawLine function.  I have tried both calls with exactly the same results.  The second line in the psrc.c file is the command line for compiling the sample program.

I am including snap shots of the correct display using 3.3.6 release and an incorrect display from the 4.2.0 release.

I have also notice another detrimental difference between 3.3.6 and the 4.x.x releases. Graphics  drawn using 3.3.6 will be retained after being covered by another window.  These are lost when using the 4.xx releases I have tried.  This is an anoying problem for my applications.  There may be a simple solution to this, but I have not discovered it.

Here is the correct display using the 3.3.6 release.  The upper right end of the green diagonals are in the little black rectangles.

psrc_5.0.gif


Here is the incorrect display using the 4.2.0 release.  The red horizontal line and the black rectangles are correct.  The green diagonals are not.

psrc_8.2.gif psrc_8.2.gif psrc_8.2.gif psrc_8.2.gif


I would like to know if this has been previously encountered by other developers.

Thank you,

Keith Tang
Marathon Electric Co.
Wausau, WI

715 675-3359 ext 4292


GIF image

GIF image

GIF image

GIF image

GIF image

/*
gcc psrc.c -o psrc -L /usr/X11/lib -lforms -lX11 -lm
*/

	#include <stdlib.h>
	#include <unistd.h>

	#include "forms.h"

/*	#include "ptst.h"*/

/**********************/
/** Header file generated with fdesign on Wed Nov  5 08:03:50 2003.**/

#ifndef FD_ptst0_h_
#define FD_ptst0_h_

/** Callbacks, globals and object handlers **/


/**** Forms and Objects ****/
typedef struct
{
	FL_FORM *ptst0;
	void *vdata;
	char *cdata;
	long  ldata;
}
FD_ptst0;

extern FD_ptst0 * create_form_ptst0(void);

#endif /* FD_ptst0_h_ */
/**********************/

void plot(void);



int main(int argc, char *argv[])
{
	int i;
	FD_ptst0 *myfdui;
	FL_OBJECT *but;
	
	printf("1\n");
	fl_initialize(&argc, argv, "psrc", 0, 0);
	printf("2\n");
	myfdui = create_form_ptst0();
	printf("3\n");
	fl_show_form(myfdui->ptst0,FL_PLACE_CENTER,FL_FULLBORDER,"psrc");
	printf("4\n");

	plot();

	while (1)
	{
		but=fl_do_forms();
		plot();
		printf("5\n");
		usleep(100000);
	}
}


void plot(void)
{
	long i, y, j;
	
	for (j = 0; j < 25; ++j)
	{
		y = 675-24*j;

		printf("y:%d\n", y);

		/* draw the little rectangle at xy point	*/
		fl_rect(408, y-2, 4, 4, FL_BLACK);

		/* draw from origin to the xy point */
		fl_line(50, 675, 410, y, FL_GREEN);

		/* draw horizontal line at the y position	*/
		fl_line(50, y, 410, y, FL_RED);
	}

}



FD_ptst0 *create_form_ptst0(void)
{
  FL_OBJECT *obj;
  FD_ptst0 *fdui = (FD_ptst0 *) fl_calloc(1, sizeof(*fdui));

  fdui->ptst0 = fl_bgn_form(FL_NO_BOX, 500, 700);
  obj = fl_add_box(FL_UP_BOX,0,0,500,700,"");
  obj = fl_add_button(FL_NORMAL_BUTTON,10,10,70,20,"replot");
  fl_end_form();

  fdui->ptst0->fdui = fdui;

  return fdui;
}




[Index of Archives]     [X Forum]     [Xorg]     [XFree86 Newbie]     [IETF Announce]     [Security]     [Font Config]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux Kernel]

  Powered by Linux